Skip to content

fix: increase Test_Server_CapabilityError timeout to prevent race wit…#22501

Draft
Tofel wants to merge 1 commit into
developfrom
fix/flaky-CRE-4319-2026-05-15-clean
Draft

fix: increase Test_Server_CapabilityError timeout to prevent race wit…#22501
Tofel wants to merge 1 commit into
developfrom
fix/flaky-CRE-4319-2026-05-15-clean

Conversation

@Tofel
Copy link
Copy Markdown
Contributor

@Tofel Tofel commented May 15, 2026

Summary

  • Increases RequestTimeout from 100ms to 10s in Test_Server_CapabilityError to eliminate a race condition between the server's expiry ticker and async message delivery.

Root cause

RequestTimeout=100ms equalled the ticker interval returned by getServerTickerInterval. On loaded CI machines, the expiry goroutine fires Cancel(Error_TIMEOUT) before all 10 async messages from 10 workflow peers complete delivery through testAsyncMessageBroker's serial sendCh consumer. The 10th OnMessage then finds hasResponse()==true (set by Cancel) and dispatches Error_TIMEOUT instead of the expected Error_INTERNAL_ERROR.

Fix

Raise the timeout to 10s — matching the convention used by other tests in this file. TestErrorCapability returns synchronously, so the test still completes in milliseconds; only the safety margin changes.

Flaky test fixes

Issue Test Trunk
CRE-4319 Test_Server_CapabilityError Trunk test case

Test plan

  • Test_Server_CapabilityError passed 10/10 runs locally with -race -shuffle=on
  • golangci-lint clean for ./core/capabilities/remote/executable/...
  • CI green

…h expiry ticker

RequestTimeout was 100ms — equal to the ticker interval — causing the expiry
goroutine to fire Cancel(Error_TIMEOUT) before async broker delivery of all 10
messages completed on loaded CI machines.

Fixes CRE-4319
@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 15, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

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.

1 participant