Skip to content

Commit 08176a3

Browse files
committed
auto merge of #16894 : alexcrichton/rust/issue-16872, r=huonw
It was previously asserted that each thread received at least one connection, but this is not guaranteed to always be the case due to scheduling. This test also deadlocked on failure due to a lingering reference to the sending half of the channel, so that reference is now also eagerly dropped so the test can fail properly if something bad happens. Closes #16872
2 parents 27e8d5b + 4ddbb0d commit 08176a3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/test/run-pass/tcp-accept-stress.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-macos #16872 spurious deadlock
12-
1311
#![feature(phase)]
1412

1513
#[phase(plugin)]
@@ -49,11 +47,9 @@ fn test() {
4947
let tx = tx.clone();
5048
spawn(proc() {
5149
let mut a = a;
52-
let mut mycnt = 0u;
5350
loop {
5451
match a.accept() {
5552
Ok(..) => {
56-
mycnt += 1;
5753
if cnt.fetch_add(1, atomic::SeqCst) == N * M - 1 {
5854
break
5955
}
@@ -62,7 +58,6 @@ fn test() {
6258
Err(e) => fail!("{}", e),
6359
}
6460
}
65-
assert!(mycnt > 0);
6661
tx.send(());
6762
});
6863
}
@@ -77,6 +72,7 @@ fn test() {
7772
tx.send(());
7873
});
7974
}
75+
drop(tx);
8076

8177
// wait for senders
8278
assert_eq!(rx.iter().take(N).count(), N);

0 commit comments

Comments
 (0)