Skip to content

Tests: Replace wall-clock DiscoveryTimeout with deterministic timing #652

@coderabbitai

Description

@coderabbitai

Context

The DiscoveryTimeout field in ServerReconciler currently relies on wall-clock time (time.Second) in tests, which can lead to flaky behavior on slower CI runners. Tests should be deterministic and not depend on timing assumptions.

Location

  • File: internal/controller/suite_test.go
  • Field: DiscoveryTimeout (Line 201)
  • Component: ServerReconciler test setup

Issue

The test configuration sets DiscoveryTimeout: time.Second which makes envtest behavior dependent on real wall-clock time. This violates the principle that tests should be deterministic.

Background

This issue was identified during review of PR #536, though it is a pre-existing concern not introduced by that PR.

Reported by: @asergeant01

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions