Skip to content

Report the compile failure of the concurrent async request test - #8989

Merged
cknitt merged 1 commit into
masterfrom
drift-8979-async-test-cleanup
Oct 23, 2026
Merged

cknitt merged 1 commit into
masterfrom
drift-8979-async-test-cleanup

Conversation

@cknitt

@cknitt cknitt commented Oct 23, 2026

Copy link
Copy Markdown
Member

Fixes #8979.

When a compile failed in the concurrent_async_context unit test, List.iter Domain.join re-raised at the first failed join while the other seven domains were still compiling into the temporary directory. with_temp_dir's cleanup then raced with them and failed with ENOTEMPTY. Fun.protect reported only Fun.Finally_raised: Unix.Unix_error(Unix.ENOTEMPTY, "rmdir", ...), which hid the compile error and left a rewatch-driver-async-domains-* directory behind.

  • A new join_all joins every domain before re-raising the first failure, keeping its backtrace. The test uses it in place of List.iter Domain.join.
  • with_temp_dir re-raises the action's own exception, and in that case removing the directory is best effort. After a successful action, a cleanup error still fails the test. This applies to every test that uses the helper.

Checked by running the test without a compiled runtime, the reproduction from the issue: it now fails with the compile error ("The module or file Primitive_promise can't be found") and leaves no directory behind.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xk6AeCYpCK4SZRtHYKHGoe

When a compile failed in `concurrent_async_context`, the first failed join
re-raised while other domains were still writing, and `with_temp_dir`'s
cleanup then failed with ENOTEMPTY: `Fun.protect` reported only
`Finally_raised` and the directory was left behind. The test now joins every
domain before re-raising, and a failed body's cleanup is best effort.

Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xk6AeCYpCK4SZRtHYKHGoe
@github-actions

Copy link
Copy Markdown

Semantic Diff

1 commit · Full page

Report the compile failure of the concurrent async request test

457cf5a · Christoph Knittel with Claude Opus 5.5 · Oct 23, 2026

When a compile failed in concurrent_async_context, the first failed join re-raised while other domains were still writing, and with_temp_dir's cleanup then failed with ENOTEMPTY: Fun.protect reported only Finally_raised and the directory was left behind. The test now joins every domain before re-raising, and a failed body's cleanup is best effort.

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.22%. Comparing base (9e2f371) to head (457cf5a).

Files with missing lines Patch % Lines
tests/ounit_tests/ounit_compiler_request_tests.ml 69.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8989      +/-   ##
==========================================
- Coverage   81.22%   81.22%   -0.01%     
==========================================
  Files         457      457              
  Lines       63862    63873      +11     
==========================================
+ Hits        51875    51882       +7     
- Misses      11987    11991       +4     
Files with missing lines Coverage Δ
tests/ounit_tests/ounit_compiler_request_tests.ml 97.15% <69.23%> (-0.38%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8989

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@8989

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8989

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8989

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8989

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8989

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8989

commit: 457cf5a

@github-actions

Copy link
Copy Markdown

@cknitt
cknitt marked this pull request as ready for review October 23, 2026 09:25
@cknitt

cknitt commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T09:27:10.615715Z 457cf5a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 457cf5a0dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@cknitt
cknitt requested a review from cristianoc October 23, 2026 09:27
@cknitt
cknitt enabled auto-merge (squash) October 23, 2026 09:28
@cknitt
cknitt merged commit 543aa20 into master Oct 23, 2026
26 checks passed
@cknitt
cknitt deleted the drift-8979-async-test-cleanup branch October 23, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

concurrent_async_context reports a cleanup error instead of the compile failure and leaks its temp dir

2 participants