Repository navigation
Fix watch tests that flake on duplicate change events - #8902
Conversation
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8902 |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Windows can report one write as several change events, each rebuilding and re-reporting A. Wait for those rebuilds before counting, then poll for A's re-parse after the edit of B. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0193XhTJFgkaaGZTNw9Uqd5v Signed-off-by: Christoph Knittel <ck@cca.io>
06dd6eb to
44018a2
Compare
The quiet-watch parity check compares the stderr of Rust and OCaml rewatch after a parse error. macOS and Windows can report one write as several change events, and each rebuild prints the error again, so the check now collapses consecutive identical error reports before comparing. Review: Where did this fail? On macOS in #8902: Rust printed the parse error twice, OCaml once, with identical text. Area: rewatch tests Output: unchanged Tests: ~rewatch-ocaml/tests/check_command_validation.sh Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0193XhTJFgkaaGZTNw9Uqd5v Signed-off-by: Christoph Knittel <ck@cca.io>
macOS and Windows can report a single write as several change events. Both watchers rebuild for each one, and each rebuild of a source that fails to parse reports its error again. Two tests counted those reports:
Retained parse (OCaml focused tests, Windows). The Windows
build-compilerjob failed in #8900 and #8894 at:The test makes
A.resfail to parse, counts A's parses, editsB.res, waits for a second error report and expects another parse of A. A duplicate rebuild of A can log its parse before the count and print its error before the build for B parses A, so the "second" error isn't B's. The test now waits until A's parse count has been unchanged for a second before counting, expects one more error than was reported by then, and polls for A's re-parse instead of checking once.Quiet-watch parity check (macOS). The check compares the stderr of Rust and OCaml rewatch after a parse error. On macOS in this PR, Rust printed the identical error twice and OCaml once. The check now collapses consecutive identical error reports before comparing.
New checks: locally I rewrote
A.reswith the same content 0.3 s after the failing edit, which forces a duplicate rebuild, and the retained-parse test still passed. On the stderr pair from the failing macOS log, the collapsed outputs are identical.🤖 Generated with Claude Code
https://claude.ai/code/session_0193XhTJFgkaaGZTNw9Uqd5v