Skip to content

Wait for exec before snapshot#290

Merged
thomasjpfan merged 2 commits intomainfrom
thomasjpfan/flaky-test
Feb 27, 2026
Merged

Wait for exec before snapshot#290
thomasjpfan merged 2 commits intomainfrom
thomasjpfan/flaky-test

Conversation

@thomasjpfan
Copy link
Contributor

This PR fixes the snapshotFilesystem flaky test by waiting on the exec.

@cursor
Copy link

cursor bot commented Feb 27, 2026

PR Summary

Low Risk
Low risk test-only change that reduces flakiness by ensuring sb.exec() commands finish before taking a snapshot; no production logic is modified.

Overview
Fixes a flaky snapshotFilesystem test by explicitly waiting for the file-write and directory-create sb.exec() processes to complete before calling sb.snapshotFilesystem().

This changes the test to capture exec handles (writeFile, mkDir) and await ...wait() on each, ensuring the subsequent snapshot reliably contains the expected filesystem state.

Written by Cursor Bugbot for commit 84135b8. This will update automatically on new commits. Configure here.

Copy link
Contributor

@ehdr ehdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I think there are a bunch more .exec that we don't .wait for (also in Go?), but can fix those separately too if you prefer.

@thomasjpfan
Copy link
Contributor Author

I think there are a bunch more .exec that we don't .wait for (also in Go?)

Yea, I prefer to follow up fixing it. I've seen this specific snapshot test fail often enough on main + PRs.

@thomasjpfan thomasjpfan merged commit ab68c3e into main Feb 27, 2026
6 checks passed
@thomasjpfan thomasjpfan deleted the thomasjpfan/flaky-test branch February 27, 2026 16:11
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.

2 participants