Skip to content

Commit

Permalink
[WFCORE-6825] Allow the timeout to be adjusted for slow CI.
Browse files Browse the repository at this point in the history
Also use the noRequestTimeout parameter in the configuration set.
  • Loading branch information
darranl committed May 21, 2024
1 parent 2e551a0 commit 0227d73
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package org.wildfly.core.test.standalone.mgmt;

import static org.jboss.as.test.shared.TimeoutUtil.adjust;
import static org.junit.Assert.assertTrue;

import java.io.IOException;
Expand All @@ -14,6 +15,7 @@

import jakarta.inject.Inject;
import org.jboss.as.test.integration.management.util.CLIWrapper;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.common.function.ExceptionRunnable;
Expand Down Expand Up @@ -99,7 +101,7 @@ public void testTimeout() throws Exception {
}
assertTrue("Opening of one socket was expected to fail.", oneFailed);

Thread.sleep(5000); // We also had 1000ms on the bad socket so we know we are past the timeout.
Thread.sleep(adjust(5000)); // We also had 1000ms on the bad socket so we know we are past the timeout.

Socket goodSocket = new Socket();
// This needs to be longer than 500ms to give the server time to respond to the closed connections.
Expand All @@ -119,7 +121,7 @@ private void runTest(int noRequestTimeout, ExceptionRunnable<Exception> test) th
cli.sendLine(String.format("/system-property=%s:add(value=%d)", BACKLOG_PROPERTY, 2));
cli.sendLine(String.format("/system-property=%s:add(value=%d)", CONNECTION_HIGH_WATER_PROPERTY, 6));
cli.sendLine(String.format("/system-property=%s:add(value=%d)", CONNECTION_LOW_WATER_PROPERTY, 3));
cli.sendLine(String.format("/system-property=%s:add(value=%d)", NO_REQUEST_TIMEOUT_PROPERTY, 5000));
cli.sendLine(String.format("/system-property=%s:add(value=%d)", NO_REQUEST_TIMEOUT_PROPERTY, noRequestTimeout));
}

try {
Expand Down

0 comments on commit 0227d73

Please sign in to comment.