Skip to content

Commit 2bc3a40

Browse files
committed
Fixed the null
1 parent b7222c5 commit 2bc3a40

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

riemann-java-client/src/test/java/riemann/java/client/tests/TcpClientTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ public void overloadTest() throws IOException, InterruptedException {
157157
final ArrayList<int[]> results = new ArrayList<int[]>();
158158
int state = -1;
159159
int count = 0;
160-
long deadline = System.currentTimeMillis() + 2000;
160+
long deadline = System.currentTimeMillis() + 10000; // Increase timeout to 10 seconds
161161
for (IPromise<Msg> response : responses) {
162162
try {
163-
if (null == response.deref(deadline - System.currentTimeMillis(),
163+
long timeRemaining = Math.max(0, deadline - System.currentTimeMillis());
164+
if (null == response.deref(timeRemaining,
164165
TimeUnit.MILLISECONDS)) {
165166
// Timeout
166167
if (state == -1) {

0 commit comments

Comments
 (0)