Repository navigation
browser: fix flaky TestOpenDoesNotWaitForLauncherChild cleanup - #8210
Conversation
The test opens twice, and each open starts a sleeper that writes the same file when it ends. The cleanup waited only until that file existed, so it went ahead after the first sleeper, and the second sleeper could write the file again while TempDir was being removed: "unlinkat ...: directory not empty". Give each open its own TempDir and file and wait for both. The sleeper now writes a temporary file and renames it into place, so the file appears only after it is closed and the cleanup cannot race an open handle on Windows. Co-authored-by: Isaac <no-reply@databricks.com>
|
🤖 /trigger all AI agent (opus5.5, isaac_claude) |
✅ Integration test reportCommit: 6512a96
Top 3 slowest tests (at least 2 minutes):
|
There was a problem hiding this comment.
Automated review at c350184. Each finding was verified against the code.
No blocking issues found.
This PR fixes the flaky TestOpenDoesNotWaitForLauncherChild by giving each of the two opens its own sleeper file and cleanup wait. Each sleeper now also writes a temp file and renames it into place, so the marker appears only after the file is closed. I checked the cleanup order: each waitForSleeper is registered after the t.TempDir cleanup, so it runs before RemoveAll, and both sleepers must finish before the directory is removed. I found nothing that needs to change. Two smaller things I checked didn't hold up: the old os.WriteFile error was already thrown away, so a failed rename adds no new silent failure, and the code comment correctly says each open gets its own sleepFile.
Co-authored-by: Isaac <no-reply@databricks.com>
|
🤖 Thanks, no change needed for this review. Since then, 6512a96 switches the sleeper's write-then-rename to AI agent (opus5.5, isaac_claude) |
Changes
Fix the flaky
TestOpenDoesNotWaitForLauncherChild(libs/browser). Test-only change.The test opens twice, and each open starts a sleeper that writes the same file in the test's TempDir when it ends. The cleanup waited only until that file existed, so it could proceed after the first sleeper while the second one (measured 3-17ms later) wrote the file again during TempDir removal:
unlinkat ...: directory not empty. Each open now gets its own TempDir and file, and the cleanup waits for both. The sleeper writes the file withlibs/atomicfile(temp file and rename), so the file appears only after it is closed (avoids racing an open handle on Windows).Dashboard
TempDir RemoveAll cleanup: unlinkat [PATH]: directory not empty, Linux and macOS, unrelated PRs, since the test was added on 2026-11-19.Tests
-race; 180 stress runs of allTestOpen*tests passed.Gaps and risks
🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.