Repository navigation
Store browser screenshots in BreakTest DB next to their error rows - #6
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rowSink),processBrowserErrorwrites abrowser_screenshotsrow[time, run_id, sha256, "image/png", base64]before therequests_errorrow that references it (row[14]).dbScreenshotBytes(7 MiB base64) are dropped with a log line, and the error row's reference is cleared, so no reference dangles.encodeDBRowallows a screenshot row up to that bound. Other tables keep the 2 MiB bound."browser_screenshots": "tssss", included in the multipart batch.K6_BROWSER_SCREENSHOT_ON_ERROR=trueand the guard that failed the run on screenshot tags.pendingScreenshotspath 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/...andgo vetpass locally.🤖 Generated with Claude Code