Skip to content

Commit

Permalink
increase timeout to 1 minute
Browse files Browse the repository at this point in the history
  • Loading branch information
hertzsprung committed May 3, 2024
1 parent a848294 commit ece6477
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ void sendsCustomCloudWatchMetricOnGitHubWorkflowStatusEvent() {

deliverGitHubWorkflowStatusEvent(cloudWatch, workflowCompletionTime);

await().atMost(30, SECONDS).untilAsserted(() -> assertThat(cloudwatchMetrics(cloudWatch)).isEqualTo(workflowCompletionTime));
await()
.atMost(60, SECONDS)
.pollInterval(1, SECONDS)
.untilAsserted(() -> assertThat(cloudwatchMetrics(cloudWatch)).isEqualTo(workflowCompletionTime));
}
}
}
Expand All @@ -51,14 +54,14 @@ private void deliverGitHubWorkflowStatusEvent(CloudWatchClient cloudWatch, long
private Double cloudwatchMetrics(CloudWatchClient cloudWatch) {
GetMetricDataResponse response = cloudWatch.getMetricData(b -> b
.maxDatapoints(1)
.startTime(Instant.now().minusSeconds(60))
.startTime(Instant.now().minusSeconds(120))
.metricDataQueries(q -> q
.id("workflowCompletionTime")
.metricStat(s -> s.metric(m -> m
.namespace("DatumEdge/Binsley/Test/Workflow")
.metricName("CompletionTime"))
.stat("Maximum")
.period(60 /* seconds */)))
.period(120 /* seconds */)))
.endTime(Instant.now())
);

Expand Down

0 comments on commit ece6477

Please sign in to comment.