Skip to content

fix cloudwatchlogs flaky tests - #754

Open
Paamicky wants to merge 6 commits into
mainfrom
mcommey/fix-cloudwtch-logs-flaky-tests
Open

fix cloudwatchlogs flaky tests#754
Paamicky wants to merge 6 commits into
mainfrom
mcommey/fix-cloudwtch-logs-flaky-tests

Conversation

@Paamicky

@Paamicky Paamicky commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description of the issue

Two CloudWatch Logs tests are intermittently flaky because each validates once, right after the agent acts, with no retry for CloudWatch's propagation lag. TestWriteLogsToCloudWatch fails its exact count assertion when GetLogsSince (which only retries on ResourceNotFoundException) queries a stream whose events haven't surfaced yet. TestLogGroupClass fails IsLogGroupExists(...) because DescribeLogGroups is eventually consistent and can return empty right after the group is created.

Description of changes

  • Add awsservice.ValidateLogsWithRetry, a bounded re-validation wrapper around ValidateLogs that absorbs CloudWatch propagation delay without faking a pass
  • Add IsLogGroupExistsWithRetry (polls IsLogGroupExists, bounded by attempts/interval) and use it in TestLogGroupClass with 6 attempts at 15s.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests generator cloudwatchlogs-only matrix

Note

AL2023 failure is an environment issue and will be fixed on a different PR

@Paamicky
Paamicky requested a review from a team as a code owner September 2, 2026 18:46
@Paamicky
Paamicky force-pushed the mcommey/fix-cloudwtch-logs-flaky-tests branch from 00c5ced to 04ba75a Compare September 2, 2026 23:08
@Paamicky
Paamicky changed the base branch from main to fix/loggroupclass-flaky-isloggroupexists-retry September 3, 2026 16:17
@Paamicky
Paamicky changed the base branch from fix/loggroupclass-flaky-isloggroupexists-retry to main September 3, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants