The GitHub Actions job "CI" on 
grails-core.git/fix/flaky-per-test-recording-spec has failed.
Run started by GitHub user borinquenkid (triggered by borinquenkid).

Head commit for run:
24a0b59c1b3d6916d9c2515b362e7f44d64abcf4 / Walter Duque de Estrada 
<[email protected]>
Fix the real causes behind PerTestRecordingSpec's flakiness

Review on this PR (apache/grails-core#16031) showed the original fix's
diagnosis doesn't hold: GebRecordingTestListener.afterIteration calls
BrowserWebDriverContainer.afterTest -> saveRecordingToFile synchronously
on the test thread, and saveRecordingToFile's own Files.copy blocks
until the copy is done - verified directly against the Testcontainers
2.0.5 source. There is no concurrent writer for a directory scan to
race against, so the size-stability polling added here didn't remove a
race; it just added latency.

The more likely real cause: a VNC recording container that was just
restarted (WebDriverContainerHolder#restartVncRecordingContainer) is
only guaranteed to have connected, not to have captured meaningful
frames, by the time a fast test iteration finishes. Two such near-blank
captures can encode to identical, non-zero, size-stable bytes via
ffmpeg, passing both the old and the new check without being distinct,
meaningful recordings.

- PerTestRecordingSpec: revert the stability-polling change, and
  instead assert each recording independently exceeds a sensible
  minimum size before asserting the two differ - this is the actual
  framework contract, not raw byte inequality of ffmpeg output.
- WebDriverContainerHolder#restartVncRecordingContainer: fix a real bug
  found while investigating - the vncRecordingContainer field was set
  to the new container BEFORE start() was called, so a thrown (and
  swallowed) start() failure left the field pointing at a container
  that never actually started.
- WebDriverContainerHolder#stop: wrap container?.stop() in try/finally
  so a thrown stop() also can't skip the state reset, leaving
  isInitialized() reporting true for a broken container.

Verified against the real Testcontainers-backed integration test
(PerTestRecordingSpec, 3/3 passing) and repo-wide codeStyle.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

Report URL: https://github.com/apache/grails-core/actions/runs/30234575730

With regards,
GitHub Actions via GitBox

Reply via email to