Skip to content

Commit

Permalink
Fix threads test
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Feb 25, 2024
1 parent a01dfca commit 69c126d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub fn test_mutants(
for build_dir in build_dirs {
threads.push(scope.spawn(|| {
let build_dir = build_dir; // move it into this thread
trace!("start thread in {build_dir:?}");
trace!(thread_id = ?thread::current().id(), ?build_dir, "start thread");
loop {
// Not a while loop so that it only holds the lock briefly.
let next = numbered_mutants.lock().expect("lock mutants queue").next();
Expand Down
2 changes: 1 addition & 1 deletion tests/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn jobs_option_accepted_and_causes_multiple_threads() {
// This might be brittle, as the ThreadId debug form is not specified, and
// also _possibly_ everything will complete on one thread before the next
// gets going, though that seems unlikely.
let re = Regex::new(r#"\{thread=ThreadId\(\d+\)\}"#).expect("compile regex");
let re = Regex::new(r#"start thread thread_id=ThreadId\(\d+\)"#).expect("compile regex");
let matches = re
.find_iter(&debug_log)
.map(|m| m.as_str())
Expand Down

0 comments on commit 69c126d

Please sign in to comment.