Dale Richardson created YUNIKORN-3387:
-----------------------------------------
Summary: Deterministic synctest reproduction pilot
Key: YUNIKORN-3387
URL: https://issues.apache.org/jira/browse/YUNIKORN-3387
Project: Apache YuniKorn
Issue Type: Test
Components: core - scheduler, shim - kubernetes
Reporter: Dale Richardson
Assignee: Dale Richardson
A pilot using Go's testing/synctest to turn a probabilistic data-race soak into
a
deterministic millisecond test, and to document the pattern for future FSM/lock
interleaving tests.
h3. Design
Reproduce the YUNIKORN-3376 Task.pod race (SetTaskPod vs
checkPodMetadataBeforeScheduling) deterministically: run the two conflicting
operations as goroutines inside a synctest bubble, ordered by the bubble's fake
clock, joined on a bubble-local WaitGroup; the race detector is the oracle. The
file header documents the reusable recipe and two non-obvious traps (ordering
must
come from the fake clock, not from sequencing through the root goroutine via
synctest.Wait; the root must durably block).
h3. Results
On the fixed tree (#1070 merged) it passes. With the fix reverted it fires the
race
detector deterministically 5/5 runs, all three orderings -- versus the old ~60s
probabilistic soak.
h3. Constraint found (documented)
synctest is viable here only with go-deadlock detection off: go-deadlock arms a
pooled time.AfterFunc per lock acquisition, and resetting a bubble-allocated
timer
outside the bubble is a fatal error that kills the whole test binary. The test
therefore skips itself when deadlock tracking is enabled (guarded on the core
locking flag, which the shim's locking delegates to). Consequence to weigh:
because
make test / CI run with detection enabled, this test is skipped in CI as
configured
-- it guards `go test -race` runs without detection. Scope for future use:
looplab/fsm starts no goroutines, so object-level FSM interleavings are in
reach;
anything routed through the dispatcher stays with the chaos harness.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]