Commit b9bb83f
authored
fix(fs): flush RealFs append to prevent data loss race (#586)
## Summary
- Adds `file.flush().await?` after `write_all` in `RealFs::append` to
ensure data is persisted before the file handle is dropped
- Fixes flaky `readwrite_mount_modifies_host` test that fails in CI due
to tokio's internal buffering — `write_all` returns `Ready` before the
blocking write completes, so without flush the data can be lost on drop
## Test plan
- [x] `cargo test --features realfs -p bashkit --test realfs_tests
readwrite_mount_modifies_host` passes
- [x] `cargo test --all-features --tests` passes
- [x] `cargo clippy --all-targets --all-features -- -D warnings` clean
- [ ] CI green1 parent 73f99bc commit b9bb83f
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| 296 | + | |
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
| |||
0 commit comments