File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ fn test_run_basic() {
52
52
}
53
53
54
54
#[ test]
55
- fn test_is_running ( ) {
55
+ fn test_is_finished ( ) {
56
56
let b = Arc :: new ( Barrier :: new ( 2 ) ) ;
57
57
let t = thread:: spawn ( {
58
58
let b = b. clone ( ) ;
@@ -63,14 +63,14 @@ fn test_is_running() {
63
63
} ) ;
64
64
65
65
// Thread is definitely running here, since it's still waiting for the barrier.
66
- assert_eq ! ( t. is_running ( ) , true ) ;
66
+ assert_eq ! ( t. is_finished ( ) , false ) ;
67
67
68
68
// Unblock the barrier.
69
69
b. wait ( ) ;
70
70
71
- // Now check that t.is_running () becomes false within a reasonable time.
71
+ // Now check that t.is_finished () becomes true within a reasonable time.
72
72
let start = Instant :: now ( ) ;
73
- while t . is_running ( ) {
73
+ while !t . is_finished ( ) {
74
74
assert ! ( start. elapsed( ) < Duration :: from_secs( 2 ) ) ;
75
75
thread:: sleep ( Duration :: from_millis ( 15 ) ) ;
76
76
}
You can’t perform that action at this time.
0 commit comments