Skip to content

Commit 4d93ca3

Browse files
committed
relax timeout from 1s to 10s before failure.
1 parent 0b86e41 commit 4d93ca3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/JmxConnectionTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import static org.assertj.core.api.Assertions.assertThat;
99

10+
import java.util.concurrent.TimeUnit;
1011
import java.util.function.Function;
1112
import org.junit.jupiter.api.AfterAll;
1213
import org.junit.jupiter.api.BeforeAll;
13-
import org.junit.jupiter.api.Disabled;
1414
import org.junit.jupiter.api.Test;
1515
import org.slf4j.Logger;
1616
import org.slf4j.LoggerFactory;
@@ -23,7 +23,6 @@
2323
* JmxConnectionBuilder and relies on containers to minimize the JMX/RMI network complications which
2424
* are not NAT-friendly.
2525
*/
26-
@Disabled // failing with "container should stop when testing connection"
2726
public class JmxConnectionTest {
2827

2928
// OTLP endpoint is not used in test mode, but still has to be provided
@@ -102,11 +101,11 @@ private static void checkConnectionLogs(JmxScraperContainer scraper, boolean exp
102101
}
103102

104103
private static void waitTerminated(GenericContainer<?> container) {
105-
int retries = 10;
104+
long retries = TimeUnit.SECONDS.toMillis(10);
106105
while (retries > 0 && container.isRunning()) {
107106
retries--;
108107
try {
109-
Thread.sleep(100);
108+
TimeUnit.MILLISECONDS.sleep(100);
110109
} catch (InterruptedException e) {
111110
throw new RuntimeException(e);
112111
}

0 commit comments

Comments
 (0)