Skip to content

cre-4229: system-tests: replace sleep with polling for report generat…#22378

Open
mchain0 wants to merge 1 commit into
developfrom
cre-4229
Open

cre-4229: system-tests: replace sleep with polling for report generat…#22378
mchain0 wants to merge 1 commit into
developfrom
cre-4229

Conversation

@mchain0
Copy link
Copy Markdown
Contributor

@mchain0 mchain0 commented May 11, 2026

After hooking into mock executable capabilities, the test used a fixed
5-second sleep to wait for the report to be generated before starting
the load test. This is fragile: report generation may take longer under
load, causing false test failures, or complete sooner, wasting time.

Replace the sleep with a polling loop that checks whether the capability
has received its first request on the channel, confirming the report is
ready. The polling uses a 30-second timeout with 1-second intervals.

cre-4229

@github-actions
Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@cl-sonarqube-production
Copy link
Copy Markdown

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 11, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@mchain0 mchain0 marked this pull request as ready for review May 11, 2026 13:18
@mchain0 mchain0 requested review from a team as code owners May 11, 2026 13:18
Comment on lines +499 to +506
// Poll until the capability has received at least one request, confirming
// the report has been generated and the capability is ready.
select {
case <-receiveChannel:
testLogger.Info().Msg("Capability report generated and ready")
default:
time.Sleep(time.Second * 5) // fallback: wait briefly then proceed
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this meant to be polling in a loop?

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.

3 participants