carlos / platform Public

Flake: activator writes generations.json after Shutdown (TempDir not empty) open

internal/activator TestStatelessConfigAdmissionKeepsOwnershipClassification/stateless=true/rootfs=true failed once on CI (run on ce8733bb, branch gate-parallel-lists, which does not touch the activator):

testing.go:1464: TempDir RemoveAll cleanup: unlinkat /tmp/TestStatelessConfigAdmissionKeepsOwnershipClassificationstatele3694853646/003: directory not empty

What it points at: in newWakeRelRig (rootfswakereleasetest.go:248) the third t.TempDir() is the directory of gensFile (generations.json). service() registers a.Shutdown as a cleanup after that TempDir, so Shutdown runs first and the directory is removed after it. A file appearing in that directory while RemoveAll ran means something still called persistGenerations / release.WriteGenerations (generationsfile.go:292-313) after Shutdown returned: some goroutine of the refused wake (the config-refusal path) is not one Shutdown waits for.

Worth checking whether that is only a test-rig race or a real "Shutdown returns while a generations write is in flight" in production; in production it would be a write after the drain that Shutdown is supposed to prove. Not fixed on gate-parallel-lists: it is activator code (census overlay territory) and unrelated to that branch.

Seen again on instance-gomemlimit-991 (internal_activator@3): TestRootfsWorkersStartAfterWebHealthy, 'TempDir RemoveAll cleanup: unlinkat .../004: directory not empty'. Fake backend; the branch doesn't touch rootfs workers.