mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
Fix Principal topic monitor not initialized panic
Like 1b16d318cc, reproduces with `cargo test test_pthread`
Fix by using stdlib `println!` to avoid interacting with topicMonitor.
Enable `allow-print-in-tests` like with crates/printf, such that there i
no deny-warning.
This commit is contained in:
committed by
Peter Ammon
parent
8dee291200
commit
79bf53aaa5
@@ -233,6 +233,8 @@ unused_trait_names = "warn"
|
||||
# In the future, they might change to flag other methods of printing.
|
||||
print_stdout = "deny"
|
||||
print_stderr = "deny"
|
||||
# usage in tests is fine since it avoids interacting with TopicMonitor
|
||||
# and is configured in clippy.toml with `allow-print-in-tests`
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
1
clippy.toml
Normal file
1
clippy.toml
Normal file
@@ -0,0 +1 @@
|
||||
allow-print-in-tests = true
|
||||
@@ -458,7 +458,7 @@ struct Context {
|
||||
let made = spawn(move || {
|
||||
ctx2.val.fetch_add(2, Ordering::Release);
|
||||
ctx2.condvar.notify_one();
|
||||
printf!("condvar signalled\n");
|
||||
println!("condvar signalled");
|
||||
});
|
||||
assert!(made);
|
||||
|
||||
@@ -466,9 +466,9 @@ struct Context {
|
||||
let (_lock, timeout) = ctx
|
||||
.condvar
|
||||
.wait_timeout_while(lock, Duration::from_secs(5), |()| {
|
||||
printf!("looping with lock held\n");
|
||||
println!("looping with lock held");
|
||||
if ctx.val.load(Ordering::Acquire) != 5 {
|
||||
printf!("test_pthread: value did not yet reach goal\n");
|
||||
println!("test_pthread: value did not yet reach goal");
|
||||
return true;
|
||||
}
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user