Skip to content

Commit 8727a0b

Browse files
committed
fix
1 parent fcd741a commit 8727a0b

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

smoke-tests/apps/SamplingOverrides/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ plugins {
44

55
dependencies {
66
implementation("org.hsqldb:hsqldb:2.5.1")
7+
8+
smokeTestImplementation("org.awaitility:awaitility:4.2.0")
79
}

smoke-tests/apps/SamplingOverrides/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/SamplingOverrides4Test.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
import static com.microsoft.applicationinsights.smoketest.EnvironmentValue.TOMCAT_8_JAVA_8_OPENJ9;
1616
import static com.microsoft.applicationinsights.smoketest.EnvironmentValue.WILDFLY_13_JAVA_8;
1717
import static com.microsoft.applicationinsights.smoketest.EnvironmentValue.WILDFLY_13_JAVA_8_OPENJ9;
18-
import static java.util.concurrent.TimeUnit.NANOSECONDS;
19-
import static java.util.concurrent.TimeUnit.SECONDS;
2018
import static org.assertj.core.api.Assertions.assertThat;
2119
import static org.awaitility.Awaitility.await;
2220

@@ -31,18 +29,20 @@ abstract class SamplingOverrides4Test {
3129
@Test
3230
@TargetUri(value = "/health-check", callCount = 100)
3331
void testSampling() throws Exception {
34-
await().untilAsserted(() -> {
35-
int requestCount = testing.mockedIngestion.getCountForType("RequestData");
36-
int dependencyCount = testing.mockedIngestion.getCountForType("RemoteDependencyData");
37-
int logCount = testing.mockedIngestion.getCountForType("MessageData");
38-
39-
assertThat(requestCount).isGreaterThanOrEqualTo(25);
40-
assertThat(requestCount).isLessThanOrEqualTo(75);
41-
assertThat(dependencyCount).isGreaterThanOrEqualTo(2);
42-
assertThat(dependencyCount).isLessThanOrEqualTo(20);
43-
assertThat(logCount).isGreaterThanOrEqualTo(2);
44-
assertThat(logCount).isLessThanOrEqualTo(20);
45-
});
32+
await()
33+
.untilAsserted(
34+
() -> {
35+
int requestCount = testing.mockedIngestion.getCountForType("RequestData");
36+
int dependencyCount = testing.mockedIngestion.getCountForType("RemoteDependencyData");
37+
int logCount = testing.mockedIngestion.getCountForType("MessageData");
38+
39+
assertThat(requestCount).isGreaterThanOrEqualTo(25);
40+
assertThat(requestCount).isLessThanOrEqualTo(75);
41+
assertThat(dependencyCount).isGreaterThanOrEqualTo(2);
42+
assertThat(dependencyCount).isLessThanOrEqualTo(20);
43+
assertThat(logCount).isGreaterThanOrEqualTo(2);
44+
assertThat(logCount).isLessThanOrEqualTo(20);
45+
});
4646

4747
testing
4848
.mockedIngestion

0 commit comments

Comments
 (0)