Commit e5e39c60 authored by Tobias Koppers's avatar Tobias Koppers

ensure tests are dropping turbo tasks correctly

parent a8c849a3
...@@ -114,6 +114,10 @@ where ...@@ -114,6 +114,10 @@ where
let start = std::time::Instant::now(); let start = std::time::Instant::now();
tt.stop_and_wait().await; tt.stop_and_wait().await;
println!("Stopping TurboTasks took {:?}", start.elapsed()); println!("Stopping TurboTasks took {:?}", start.elapsed());
assert!(Arc::strong_count(&tt) == 1);
let start = std::time::Instant::now();
drop(tt);
println!("Dropping TurboTasks took {:?}", start.elapsed());
for i in 10..20 { for i in 10..20 {
let tt = registration.create_turbo_tasks(&name, false); let tt = registration.create_turbo_tasks(&name, false);
println!("Run #{i} (with persistent cache if available, new TurboTasks instance)"); println!("Run #{i} (with persistent cache if available, new TurboTasks instance)");
...@@ -123,6 +127,10 @@ where ...@@ -123,6 +127,10 @@ where
let start = std::time::Instant::now(); let start = std::time::Instant::now();
tt.stop_and_wait().await; tt.stop_and_wait().await;
println!("Stopping TurboTasks took {:?}", start.elapsed()); println!("Stopping TurboTasks took {:?}", start.elapsed());
assert!(Arc::strong_count(&tt) == 1);
let start = std::time::Instant::now();
drop(tt);
println!("Dropping TurboTasks took {:?}", start.elapsed());
assert_eq!(first, third); assert_eq!(first, third);
} }
Ok(()) Ok(())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment