@@ -16,6 +16,8 @@ fn join1() {
16
16
run ( future:: try_join ( ok :: < i32 , i32 > ( 1 ) , ok ( 2 ) ) . map_ok ( move |v| tx. send ( v) . unwrap ( ) ) ) ;
17
17
assert_eq ! ( rx. recv( ) , Ok ( ( 1 , 2 ) ) ) ;
18
18
assert ! ( rx. recv( ) . is_err( ) ) ;
19
+
20
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
19
21
}
20
22
21
23
#[ test]
@@ -30,6 +32,8 @@ fn join2() {
30
32
c2. send ( 2 ) . unwrap ( ) ;
31
33
assert_eq ! ( rx. recv( ) , Ok ( ( 1 , 2 ) ) ) ;
32
34
assert ! ( rx. recv( ) . is_err( ) ) ;
35
+
36
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
33
37
}
34
38
35
39
#[ test]
@@ -43,6 +47,8 @@ fn join3() {
43
47
assert_eq ! ( rx. recv( ) , Ok ( 1 ) ) ;
44
48
assert ! ( rx. recv( ) . is_err( ) ) ;
45
49
drop ( c2) ;
50
+
51
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
46
52
}
47
53
48
54
#[ test]
@@ -56,6 +62,8 @@ fn join4() {
56
62
assert ! ( rx. recv( ) . is_ok( ) ) ;
57
63
drop ( c2) ;
58
64
assert ! ( rx. recv( ) . is_err( ) ) ;
65
+
66
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
59
67
}
60
68
61
69
#[ test]
@@ -73,6 +81,8 @@ fn join5() {
73
81
c3. send ( 3 ) . unwrap ( ) ;
74
82
assert_eq ! ( rx. recv( ) , Ok ( ( ( 1 , 2 ) , 3 ) ) ) ;
75
83
assert ! ( rx. recv( ) . is_err( ) ) ;
84
+
85
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
76
86
}
77
87
78
88
#[ test]
@@ -92,6 +102,8 @@ fn select1() {
92
102
c2. send ( 2 ) . unwrap ( ) ;
93
103
assert_eq ! ( rx. recv( ) , Ok ( 2 ) ) ;
94
104
assert ! ( rx. recv( ) . is_err( ) ) ;
105
+
106
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
95
107
}
96
108
97
109
#[ test]
@@ -111,6 +123,8 @@ fn select2() {
111
123
c2. send ( 2 ) . unwrap ( ) ;
112
124
assert_eq ! ( rx. recv( ) , Ok ( 2 ) ) ;
113
125
assert ! ( rx. recv( ) . is_err( ) ) ;
126
+
127
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
114
128
}
115
129
116
130
#[ test]
@@ -130,6 +144,8 @@ fn select3() {
130
144
drop ( c2) ;
131
145
assert_eq ! ( rx. recv( ) , Ok ( 2 ) ) ;
132
146
assert ! ( rx. recv( ) . is_err( ) ) ;
147
+
148
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
133
149
}
134
150
135
151
#[ test]
@@ -158,4 +174,6 @@ fn select4() {
158
174
drop ( tx) ;
159
175
160
176
t. join ( ) . unwrap ( ) ;
177
+
178
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 500 ) ) ; // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
161
179
}
0 commit comments