-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(IC-1579): Isolate TLA tests in Rust-based (non-canister) tests (#…
…2241) Switch to a `LocalKey`-based approach for Rust-based tests, and add an annotation (proc macro) that scopes the `LocalKey` to the test. Previously, we used only a global `RwLock`, which would cause traces of one test to be picked up by other tests. In contract, a `LocalKey` is task-local, eliminating the interference. We still use the `RwLock` as a fallback to store traces if the `LocalKey` is not present (i.e., no scope has been opened). This means that, first, tests that aren't annotated still collect the traces, but they aren't checked, which is a bit wasteful but should be OK as these aren't extremely heavy operations. Second, and more importantly, this means that the instrumentation will still work in canister-based tests, allowing a separate query method to pick the traces up from the global variable.
- Loading branch information
Showing
8 changed files
with
127 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.