Skip to content

ci: remove fixed sleeps in integration tests #8409

Description

@c-warren

Description

Every integration suite in host/ pays an unconditional 11-second sleep during setup, and helper code adds more fixed sleeps during tests. With ~10–14 suites running sequentially per CI job, that is ~2–2.5 minutes of pure sleeping in every integration job — and it's the main reason suite setup trips the 30s overhead limit.

Where the sleeps are:

  • host/integrationbase.gosetupSuite() ends with time.Sleep(cache.DomainCacheRefreshInterval + time.Second) (11s) to wait for registered domains to become visible. DomainCacheRefreshInterval is a hardcoded 10 * time.Second const in common/cache/domainCache.go — there is no config knob.
  • Same file — the domainCacheRefresh() helper hard-sleeps 2s; suites that call it mid-test pay 2s per call.
  • setupSuite() also registers 4–5 domains via sequential RPCs before the sleep.

Proposed changes:

  1. Make the domain-cache refresh interval injectable for tests (e.g. a test-cluster config field defaulting to the current const, set to ~100–200ms in host/ setup), or replace the fixed sleep with polling: retry DescribeDomain for each registered domain until visible, with a deadline. Either removes ~11s per suite.
  2. Apply the same treatment to the 2s sleep in domainCacheRefresh().
  3. (Small bonus) issue the 4–5 RegisterDomain calls concurrently.

A good follow-up (separate PR is fine): replace remaining time.Sleep(...) + assert patterns in host/*_test.go with require.Eventually or the existing poller helpers in host/taskpoller.go — fixed sleeps both over-wait when things are fast and flake when CI is slow.

Acceptance criteria: no unconditional multi-second sleeps in host/ suite setup; integration job time drops ~2 min; suite setup reliably under the overhead budget.

Is this a breaking change?

  • Yes
  • No

Scope of the feature (server, specific client, all clients)

Test infrastructure (host/, common/cache test hook). No production behavior change — the refresh interval keeps its current default outside tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help-wantedMaintainers welcome an external contributor to take this; may need real project context.kind/cleanupMaintenance: refactors, tests, deps/upgrades, tech debt, deprecations - no new capability.kind/featureNew capability, behavior, or public API surface that doesn't exist today.triage/needs-decisionUnderstood and ready for the TSC/domain owner to decide whether/when to prioritize.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions