This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
No assert
s in threads of tests
#25
Labels
bug
Something isn't working
Comments
cc @elBoberido |
elfenpiff
added a commit
to elfenpiff/elkodon
that referenced
this issue
Nov 1, 2023
17 tasks
elfenpiff
added a commit
that referenced
this issue
Nov 1, 2023
[#25] Fix potential deadlocks in test threads
Reopened since also |
elfenpiff
added a commit
to elfenpiff/elkodon
that referenced
this issue
Nov 3, 2023
…re setting control flow variables
elfenpiff
added a commit
to elfenpiff/elkodon
that referenced
this issue
Nov 3, 2023
…re setting control flow variables
elfenpiff
added a commit
to elfenpiff/elkodon
that referenced
this issue
Nov 3, 2023
…re setting control flow variables
17 tasks
elfenpiff
added a commit
to elfenpiff/elkodon
that referenced
this issue
Nov 3, 2023
…re setting control flow variables
@elfenpiff I found this https://stackoverflow.com/questions/35988775/how-can-i-cause-a-panic-on-a-thread-to-immediately-end-the-main-thread/36031130#36031130 The following code would terminate the whole test when an assert in a thread fails. It can also be placed in a function which could be called at the start of a test let orig_hook = panic::take_hook();
panic::set_hook(Box::new(move |panic_info| {
// invoke the default handler and exit the process
orig_hook(panic_info);
process::exit(1);
})); |
elfenpiff
added a commit
that referenced
this issue
Nov 4, 2023
[#25] no asserts before control variable settings
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Required information
If a thread in a test encounters an
assert
and suddenly terminates, it is possible that some succeeding variables, required for terminating the whole tests, are not being set. Therefore, either avoidassert
s in tests or use it only if it occurs not before such a test flow control variable.The text was updated successfully, but these errors were encountered: