SDN-IP unit test fix: Increased the timeout waiting for a message to be
received from 2s to 5s. Eventually, this should address some rare test failures. Change-Id: Ifbf024023580ac93f10e1b7fb1b1f5dd2fe361f9
Showing
1 changed file
with
7 additions
and
4 deletions
... | @@ -61,6 +61,9 @@ public class BgpSessionManagerTest { | ... | @@ -61,6 +61,9 @@ public class BgpSessionManagerTest { |
61 | private static final long DEFAULT_LOCAL_PREF = 10; | 61 | private static final long DEFAULT_LOCAL_PREF = 10; |
62 | private static final long DEFAULT_MULTI_EXIT_DISC = 20; | 62 | private static final long DEFAULT_MULTI_EXIT_DISC = 20; |
63 | 63 | ||
64 | + // Timeout waiting for a message to be received | ||
65 | + private static final int MESSAGE_TIMEOUT_MS = 5000; // 5s | ||
66 | + | ||
64 | // The BGP Session Manager to test | 67 | // The BGP Session Manager to test |
65 | private BgpSessionManager bgpSessionManager; | 68 | private BgpSessionManager bgpSessionManager; |
66 | 69 | ||
... | @@ -212,10 +215,10 @@ public class BgpSessionManagerTest { | ... | @@ -212,10 +215,10 @@ public class BgpSessionManagerTest { |
212 | peerBootstrap.connect(connectToSocket); | 215 | peerBootstrap.connect(connectToSocket); |
213 | 216 | ||
214 | // Wait until the OPEN message is received | 217 | // Wait until the OPEN message is received |
215 | - peerFrameDecoder.receivedOpenMessageLatch.await(2000, | 218 | + peerFrameDecoder.receivedOpenMessageLatch.await(MESSAGE_TIMEOUT_MS, |
216 | TimeUnit.MILLISECONDS); | 219 | TimeUnit.MILLISECONDS); |
217 | // Wait until the KEEPALIVE message is received | 220 | // Wait until the KEEPALIVE message is received |
218 | - peerFrameDecoder.receivedKeepaliveMessageLatch.await(2000, | 221 | + peerFrameDecoder.receivedKeepaliveMessageLatch.await(MESSAGE_TIMEOUT_MS, |
219 | TimeUnit.MILLISECONDS); | 222 | TimeUnit.MILLISECONDS); |
220 | 223 | ||
221 | // | 224 | // |
... | @@ -256,10 +259,10 @@ public class BgpSessionManagerTest { | ... | @@ -256,10 +259,10 @@ public class BgpSessionManagerTest { |
256 | peerBootstrap.connect(connectToSocket); | 259 | peerBootstrap.connect(connectToSocket); |
257 | 260 | ||
258 | // Wait until the OPEN message is received | 261 | // Wait until the OPEN message is received |
259 | - peerFrameDecoder.receivedOpenMessageLatch.await(2000, | 262 | + peerFrameDecoder.receivedOpenMessageLatch.await(MESSAGE_TIMEOUT_MS, |
260 | TimeUnit.MILLISECONDS); | 263 | TimeUnit.MILLISECONDS); |
261 | // Wait until the KEEPALIVE message is received | 264 | // Wait until the KEEPALIVE message is received |
262 | - peerFrameDecoder.receivedKeepaliveMessageLatch.await(2000, | 265 | + peerFrameDecoder.receivedKeepaliveMessageLatch.await(MESSAGE_TIMEOUT_MS, |
263 | TimeUnit.MILLISECONDS); | 266 | TimeUnit.MILLISECONDS); |
264 | 267 | ||
265 | // Get the BGP Session handler | 268 | // Get the BGP Session handler | ... | ... |
-
Please register or login to post a comment