Runtime.Tests flakes: metadata-renewal wire tests pace the fake clock with wall-clock delays (Live_predecessor_cadence..., Two_sdk_cadences_renew_before_expiry...) #965
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seen 2026-12-01 in the #962 repro loop: 30 full
FullyQualifiedName~DataConnections&Category!=SlowUnitruns, 3 parallel lanes, host load ~60. Each failed once; both passed on the other 29 runs.GrpcDataConfiguredDiscoveryWireTests.Live_predecessor_cadence_publishes_ordinary_delta_after_peer_adopts_next_authority(GrpcDataMetadataRenewalPredecessorWireTests.cs:50):OperationCanceledExceptionfromNextPublished(its own 10 s wall-clock timeout) waiting forp2Firstafter thewhile (elapsed < 7.5 s) { Clock.Advance(125 ms); await Task.Delay(20) }loop. Run time 12 s.GrpcDataConfiguredDiscoveryWireTests.Two_sdk_cadences_renew_before_expiry_without_reviving_old_notification_evidence(GrpcDataMetadataRenewalContinuityWireTests.cs:81):renewedLease.Remaining - crossExpiry should be greater than 00:00:07.5 but was 00:00:07.45. The 8 x{ Clock.Advance(500 ms); await Task.Delay(100) }loop can advance the fake clock past the moment the successor lease was issued, so the margin depends on how many advances land before the renewal is processed.Both drive a ManualTimeProvider in steps timed by wall-clock
Task.Delay, so under CPU load the fake clock advances further (or the real work lags further) than the assertions assume. Not investigated whether either hides a production race (cf. #859/#920/#962, which were real). Suggested: advance the clock only after an awaited positive signal (renewal issued / successor adopted) instead of on a wall-clock cadence, or assert against the clock value captured at successor issue.Found while working #962; out of scope there.
Fixed in
34014190a(mergedc38f78d1f). Wall-clock pacing is replaced with renewal-tick quiescence counters (ProjectedDataAccess.RenewalTicksQuiescentForTests) and ManualTimeProvider.AdvanceInOneStep. Also fixed a second mode where the shared node could legitimately publish 8 before 9. Production renewal logic was verified correct. A residual ~1% hang under very heavy load (also present in the original code) is tracked in #968. DataConnections on merged master: 1026/1026.