Skip to content

Commit 34af4da

Browse files
committed
Address test timing out
1 parent 11f408e commit 34af4da

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/java/com/timgroup/statsd/UnixStreamSocketTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,13 @@ public void resist_dsd_timeout() throws Exception {
178178
server.freeze();
179179

180180
Exception originalException = lastException;
181-
while (lastException == originalException) {
181+
int attempts = 0;
182+
while (lastException == originalException && attempts < 50) {\
182183
client.gauge("mycount", 20);
184+
attempts++;
185+
Thread.sleep(100);
183186
}
187+
assertTrue(lastException != originalException);
184188
assertTrue(lastException instanceof IOException);
185189
String timeoutMessage = lastException.getMessage();
186190
assertThat(timeoutMessage, anyOf(containsString("timed out"), containsString("broken"), containsString("pipe")));

0 commit comments

Comments
 (0)