Flaky test: command_runs_with_configured_cwd_and_resolves_relative_path fails with ETXTBSY
- Vorherrschende Sprache
- Rust
- Sterne
- 54.2k
- Forks
- 6.2k
- Ø Merge
- 3 T. 4 Std.
- Gemergte PRs (30 T.)
- 240
Beschreibung
**Describe the bug**
The test
`providers::command_auth::tests::command_runs_with_configured_cwd_and_resolves_relative_path`
occasionally fails on Linux CI with:
```text
failed to run auth command './get-token.sh': Text file busy (os error 26)
```
Failed CI job:
https://github.com/aaif-goose/goose/actions/runs/34327955183/job/102389802174?pr=11944
The equivalent `rustls-tls` job passed, and rerunning the test succeeds, suggesting a filesystem-related race when the temporary script is created and immediately executed.
The test was introduced in #11657.
**To reproduce**
Run repeatedly on Linux:
```bash
cargo test -p goose --lib \
providers::command_auth::tests::command_runs_with_configured_cwd_and_resolves_relative_path
```
**Expected behavior**
The test should pass reliably in CI.
**Additional context**
A possible fix is to create the script under a temporary filename and atomically rename it before execution. The exact cause should be confirmed before implementation.
Beitragsleitfaden
Rechercherichtung
The failing test is in providers::command_auth::tests::command_runs_with_configured_cwd_and_resolves_relative_path. Look at the test file to see how the temporary script './get-token.sh' is created and executed. Investigate the race condition on Linux where the file is busy (ETXTBSY). A potential fix is to write to a temporary file and rename it atomically before execution. Run the test repeatedly to reproduce the flakiness.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Bereich
- testing
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 55/100