Commit 355993c
fix: serialize VCS tests to prevent race conditions (EME-368) (#2811)
## Summary
- Fixes flaky `test_find_base_sha` test that was consistently failing on
Windows CI
- Adds `serial_test` dependency to serialize tests that share the
`GITHUB_EVENT_PATH` environment variable
- Adds `#[serial(github_event_path)]` attribute to both conflicting
tests
## Root Cause
The flakiness was caused by a race condition where two tests run in
parallel and both manipulate the same global `GITHUB_EVENT_PATH`
environment variable:
- `test_find_base_sha()`
- `test_find_head_with_github_event_path()`
When running in parallel (Rust's default), these tests could overwrite
each other's environment variable settings, causing random failures.
## Solution
Using the `serial_test` crate with `#[serial(github_event_path)]`
ensures these specific tests run sequentially while allowing other tests
to continue running in parallel.
Closes EME-368
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Serializes two VCS tests using serial_test to avoid GITHUB_EVENT_PATH
race; adds serial_test as a dev dependency.
>
> - **Tests**:
> - Add `#[serial(github_event_path)]` to
`test_find_head_with_github_event_path` and `test_find_base_sha` in
`src/utils/vcs.rs`.
> - **Dependencies**:
> - Add dev-dependency `serial_test` in `Cargo.toml`.
> - Update `Cargo.lock` with `serial_test` and transitive deps (`scc`,
`sdd`) and include `serial_test` in `sentry-cli` package deps.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c6c76f3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4ff5286 commit 355993c
3 files changed
+45
-0
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
| 809 | + | |
809 | 810 | | |
810 | 811 | | |
811 | 812 | | |
| |||
1672 | 1673 | | |
1673 | 1674 | | |
1674 | 1675 | | |
| 1676 | + | |
1675 | 1677 | | |
1676 | 1678 | | |
1677 | 1679 | | |
| |||
1751 | 1753 | | |
1752 | 1754 | | |
1753 | 1755 | | |
| 1756 | + | |
1754 | 1757 | | |
1755 | 1758 | | |
1756 | 1759 | | |
| |||
0 commit comments