noCV
BTEST-104 · Remove nondeterminism

Replace wall-clock races with explicit clock control

Practice briefBugIntermediate

A trial-expiry test fails around UTC midnight and daylight-saving changes.

Focused work estimate
2h + prerequisites
Priority in the scenario
High
Engineering practice
Time handling · Unit testing

Estimated field mix

  • Quality engineering100%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional web team reruns red builds until they pass. Shared clocks, leaked state, and unawaited work make failures hard to trust.

Setup prerequisites

  • Create a small local application with three deliberately flaky tests using synthetic data and local endpoints.

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Inject a clock into expiry calculations.
  • Cover before, at, and after expiry boundaries.
  • Restore real timers after each test.

Implementation constraints

  • Business timestamps remain UTC; local zones are test inputs.

Verification to include

  • Replay midnight and offset-boundary cases.
  • Verify leaked fake timers are detected by teardown.

Deliverables

  • Clock-based expiry tests.

Rollout and recovery

Land with the date behavior unchanged except for the documented boundary correction.

Value of the work

For the engineer: Practice controlled diagnosis, isolation, and test reliability measurement.

For the team: Recover useful failure signals and reduce blind reruns without hiding product defects.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.