Skip to content

test(rust): it_streams_watch_update_events races fs::write's truncate-then-write #1246

Closed

Description

@thekevinbot

packages/rust/tests/sdk.rs::it_streams_watch_update_events intermittently fails in the Integration tests job:

assertion `left == right` failed
  left: Text("")
 right: Text("final")

Same race #507 described for the since-removed guide test: fs::write truncates then writes, and the watcher's per-file hook can read the file between the two, so the first Update carries an empty name. Passes locally on every repeat and on re-run. Seen on https://github.com/thekevinscott/dirsql/actions/runs/37066403956/job/111035137488 (PR #1245, whose diff does not touch the watcher or this test).

Fix: write the new content to a sibling temp file and rename it over item.txt so the watcher sees one atomic replace, or accept the first event and wait for the one whose name is final.

Activity

  1. self-assigned this
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions