Repository navigation
Conversation
PerTestRecordingSpec still failed now and then in CI: the recording of its second setup test was 2447 to 2951 bytes, below the 5000 byte floor that the spec checks. That is the size of a recording of black frames only. WebDriverContainerHolder restarts the VNC recording container before each test, and starting it waited for the recorder to log "Connected". The recorder logs that when its socket connects, before the VNC handshake, and writes black frames until it has received the whole screen, 0.4 to 0.6 s later locally and longer on a busy runner. A test that finished within that time was recorded as a black screen. The pauses in the spec only made that less likely. Starting the recording container now waits until the recorder has logged "FrameBufferUpdateRequest" twice. In the debug mode that VncRecordingContainer runs it in, the recorder logs it after the handshake and again each time it has written a screen update to the recording, so the second one means that the recording shows the screen. The startup timeout stays at 15 s. PerTestRecordingSpec no longer pauses, so it checks that a test as short as a page load gets a recording of the screen.
matrei
force-pushed
the
fix/flaky-per-test-recording
branch
from
November 6, 2026 17:10
04f32f7 to
d44ef1c
Compare
🚨 All tests passed but jobs failed 🚨Failed Jobs without Test Failures❌ CI / Hibernate7 Functional Tests (Java 21, indy=false, shard 2) 🏷️ Commit: d44ef1c Rerun ControlsClick the checkbox to trigger a rerun:
Learn more about TestLens at testlens.app/docs. |
This branch has not been deployed
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.
Description
PerTestRecordingSpecstill fails now and then in CI, on 8.0.x and 8.1.x builds and on pull requests. Since #16405 and #16435, every failure in Develocity is the same: the recording of the second setup test, which loads the upload page, is 2,447–2,951 bytes, below the spec's 5,000-byte floor. That is the size of a recording of black frames only.WebDriverContainerHolderrestarts the VNC recording container before each test, and starting it waits for the recorder to logConnected. The recorder (flvrec.pyintestcontainers/vnc-recorder:1.3.0) logs that when its socket connects, before the VNC handshake, and writes black frames until it has received the whole screen. Fromselenium/standalone-chrome:4.49.0that is a raw 1920×1080 update of 8.3 MB, which locally arrived 0.4–0.6 s afterConnectedin the three connects I measured, and takes longer on a busy runner. A test that finished within that time was recorded as a black screen. The 500 ms pauses in the spec only made that less likely.WebDriverContainerHolder#createVncRecordingContainer()gives the recording container a wait strategy that waits until the recorder has loggedFrameBufferUpdateRequesttwice. In the debug mode thatVncRecordingContainerruns it in, the recorder logs it after the handshake, and again each time it has written a screen update to the recording, so the second one means that the recording shows the screen. The startup timeout stays at 15 s.PerTestRecordingSpecno longer pauses, so it checks that a test as short as a page load gets a recording of the screen. Its comments describe the cause.WebDriverContainerHolderSpecchecks the wait strategy without Docker, against output captured from the real recorder: the recording container isn't ready afterConnectedalone, and is once the screen has been recorded.Recording is off by default. With it on, each test now starts later by the time the recorder takes to receive the screen, and its recording begins with the screen instead of black frames.
Verification
WebDriverContainerHolder, 2 of 3 runs ofPerTestRecordingSpecfailed like CI: the second recording was 2,524 and 2,619 bytes. With the change, 6 of 6 runs passed. The two setup recordings were 67–69 KB, and the third test's own recording 21–25 KB, where it was about 2 KB of black frames before.WebDriverContainerHolderSpecfails without the change toWebDriverContainerHolder.:grails-geb:testpasses, 19 tests, and so does:grails-test-examples-geb:integrationTest, 16 tests in 13 specs, which records every test. Its two skipped tests are the Windows-only upload test and a@PendingFeature../gradlew clean aggregateViolations --continuepasses.