Skip to content

Commit

Permalink
fix a test that was missed in the chan/port renaming (PR #12815)
Browse files Browse the repository at this point in the history
  • Loading branch information
tedhorst committed Mar 14, 2014
1 parent b4d3243 commit e9bd121
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/test/run-pass/tcp-stress.rs
Expand Up @@ -28,10 +28,10 @@ fn main() {
});

let addr = SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: 0 };
let (p, c) = Chan::new();
let (tx, rx) = channel();
spawn(proc() {
let mut listener = TcpListener::bind(addr).unwrap();
c.send(listener.socket_name().unwrap());
tx.send(listener.socket_name().unwrap());
let mut acceptor = listener.listen();
loop {
let mut stream = match acceptor.accept() {
Expand All @@ -45,11 +45,11 @@ fn main() {
stream.write([2]);
}
});
let addr = p.recv();
let addr = rx.recv();

let (p, c) = Chan::new();
let (tx, rx) = channel();
for _ in range(0, 1000) {
let c = c.clone();
let tx = tx.clone();
spawn(proc() {
match TcpStream::connect(addr) {
Ok(stream) => {
Expand All @@ -60,15 +60,15 @@ fn main() {
},
Err(e) => debug!("{:?}", e)
}
c.send(());
tx.send(());
});
}

// Wait for all clients to exit, but don't wait for the server to exit. The
// server just runs infinitely.
drop(c);
drop(tx);
for _ in range(0, 1000) {
p.recv();
rx.recv();
}
unsafe { libc::exit(0) }
}

5 comments on commit e9bd121

@bors
Copy link
Contributor

@bors bors commented on e9bd121 Mar 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at tedhorst@e9bd121

@bors
Copy link
Contributor

@bors bors commented on e9bd121 Mar 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging tedhorst/rust/master = e9bd121 into auto

@bors
Copy link
Contributor

@bors bors commented on e9bd121 Mar 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tedhorst/rust/master = e9bd121 merged ok, testing candidate = e99d523

@bors
Copy link
Contributor

@bors bors commented on e9bd121 Mar 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = e99d523

Please sign in to comment.