Skip to content

Commit

Permalink
Scheduler: increase the timeout in OpenTelemetry integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba committed Nov 30, 2023
1 parent 3b44cde commit aa401f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class OpenTelemetryQuartzTest {
@Test
public void quartzSpanTest() {
// ensure that scheduled job is called
assertCounter("/scheduler/count", 1, Duration.ofSeconds(1));
assertCounter("/scheduler/count", 1, Duration.ofSeconds(3));
// assert programmatically scheduled job is called
assertCounter("/scheduler/count/manual", 1, Duration.ofSeconds(1));
assertCounter("/scheduler/count/manual", 1, Duration.ofSeconds(3));
// assert JobDefinition type scheduler
assertCounter("/scheduler/count/job-definition", 1, Duration.ofSeconds(1));

Expand All @@ -53,6 +53,7 @@ public void quartzSpanTest() {

private void assertCounter(String counterPath, int expectedCount, Duration timeout) {
await().atMost(timeout)
.pollInterval(Duration.ofMillis(500))
.until(() -> {
Response response = given().when().get(counterPath);
int code = response.statusCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class OpenTelemetrySchedulerTest {
@Test
public void schedulerSpanTest() {
// ensure that scheduled job is called
assertCounter("/scheduler/count", 1, Duration.ofSeconds(1));
assertCounter("/scheduler/count", 1, Duration.ofSeconds(3));
// assert JobDefinition type scheduler
assertCounter("/scheduler/count/job-definition", 1, Duration.ofSeconds(1));
assertCounter("/scheduler/count/job-definition", 1, Duration.ofSeconds(3));

// ------- SPAN ASSERTS -------
List<Map<String, Object>> spans = getSpans();
Expand All @@ -48,6 +48,7 @@ public void schedulerSpanTest() {

private void assertCounter(String counterPath, int expectedCount, Duration timeout) {
await().atMost(timeout)
.pollInterval(Duration.ofMillis(500))
.until(() -> {
Response response = given().when().get(counterPath);
int code = response.statusCode();
Expand Down

0 comments on commit aa401f1

Please sign in to comment.