提交 2e47359a 编写于 作者: J Jerome Lacoste

JENKINS-8702 unit tests improvements

hudson.UDPBroadcastThread#testMulticast hangs when the network isn't enabled on my Linux box: joinGroup throws IOException and the ready lock isn't released.
This ready lock is only used in the tests.
上级 826d9ddb
......@@ -61,10 +61,13 @@ public class UDPBroadcastThread extends Thread {
@Override
public void run() {
try {
try{
mcs.joinGroup(MULTICAST);
} finally{
ready.signal();
}
while(true) {
while(true) {
byte[] buf = new byte[2048];
DatagramPacket p = new DatagramPacket(buf,buf.length);
mcs.receive(p);
......
......@@ -17,6 +17,8 @@ import java.io.IOException;
* @author Kohsuke Kawaguchi
*/
public class UDPBroadcastThreadTest extends HudsonTestCase {
// FIXME these tests will fail if don't have a network link
/**
* Old unicast based clients should still be able to receive some reply,
* as we haven't changed the port.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册