Skip to content

Store browser screenshots in BreakTest DB next to their error rows - #6

Merged
jgaalen merged 1 commit into
masterfrom
codex/breaktest-db-screenshots
Nov 9, 2026
Merged

jgaalen merged 1 commit into
masterfrom
codex/breaktest-db-screenshots

Conversation

@jgaalen

@jgaalen jgaalen commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • In BreakTest DB mode (rowSink), processBrowserError writes a browser_screenshots row [time, run_id, sha256, "image/png", base64] before the requests_error row that references it (row[14]).
  • Screenshots over dbScreenshotBytes (7 MiB base64) are dropped with a log line, and the error row's reference is cleared, so no reference dangles. encodeDBRow allows a screenshot row up to that bound. Other tables keep the 2 MiB bound.
  • New schema "browser_screenshots": "tssss", included in the multipart batch.
  • Removed the startup rejection of K6_BROWSER_SCREENSHOT_ON_ERROR=true and the guard that failed the run on screenshot tags.
  • Without a row sink, the legacy pendingScreenshots path is unchanged.

Companion of jgaalen/breaktest#502 (storage, backend and frontend side). The change is limited to the output writer. k6 core and the browser module are untouched.

Tests

  • TestBreakTestDBStoresBrowserScreenshotsWithTheirErrors: a ~3.3 MB screenshot is stored and referenced; one over 7 MiB is dropped and leaves no reference.
  • TestBreakTestDBBatchCarriesBrowserScreenshots: the batch round-trips a 3 MiB screenshot.
  • go test ./internal/output/breakingit/... and go vet pass locally.

🤖 Generated with Claude Code

In BreakTest DB mode, processBrowserError now writes each screenshot as a
browser_screenshots row (time, run_id, hash, image/png, base64) before the
requests_error row that references it. Screenshots above 7 MiB of base64
cannot fit the storage batch bound; they are dropped with a log line and the
error row's reference is cleared, so no reference dangles. The legacy
pendingScreenshots path is unchanged when no row sink is configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jgaalen
jgaalen merged commit 22cf0dc into master Nov 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant