Skip to content

fix(testing): recover from lock poisoning in memoized! macro to preve… - #5846

Open
rohanranjan0902 wants to merge 1 commit into
clockworklabs:masterfrom
rohanranjan0902:fix-ci-flake-poison-error
Open

fix(testing): recover from lock poisoning in memoized! macro to preve…#5846
rohanranjan0902 wants to merge 1 commit into
clockworklabs:masterfrom
rohanranjan0902:fix-ci-flake-poison-error

Conversation

@rohanranjan0902

Copy link
Copy Markdown

Description of Changes

This PR fixes a CI test suite flake (Issue #5841) caused by lock poisoning in crates/testing/src/sdk.rs.

Previously, if a test panicked while compiling a module inside the memoized! macro, it would poison the Mutex holding the MEMOIZED compilation cache. Any subsequent tests attempting to access the cache would panic with a PoisonError, causing unrelated tests to fail and masking the original error.

This replaces .lock().unwrap() with .lock().unwrap_or_else(|e| e.into_inner()) on the cache mutex. This safely recovers the lock after a panic, allowing unrelated tests to continue compiling and running their own modules instead of failing in cascade.

Fixes #5841

API and ABI breaking changes

None. This is strictly a fix for the test harness.

Expected complexity level and risk

1

Trivial change using standard Rust idioms for recovering from test-induced lock poisoning.

Testing

  • Verified the unwrap_or_else syntax cleanly handles lock recovery without polluting test suite results.
  • Reviewers can check that this will allow actual underlying compilation errors to be surfaced rather than generic PoisonErrors.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Rohan Ranjan Prasad seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

CI flake: Test Suite / typescript::indexed_simple_enum, typescript::insert_call_uuid_v4,...

2 participants