Five more test helpers have the same setupTestDB bug (save db.DB but
don't restore on teardown). go test -race runs tests in parallel; when
test A sets db.DB = mockA and test B sets db.DB = mockB, if A runs
first and cleanup closes mockA, B then runs with db.DB pointing at a
closed mock.
Fixed files:
- internal/registry/liveness_test.go setupLivenessTestDB
- internal/registry/hibernation_test.go setupHibernationMock
- internal/registry/access_test.go setupMockDB
- internal/registry/healthsweep_test.go setupTestDB
- internal/scheduler/scheduler_test.go setupTestDB
All now follow: prevDB := db.DB; db.DB = mockDB;
t.Cleanup(func() { mockDB.Close(); db.DB = prevDB })
Total files fixed for mc#975: 8 files, ~20 test helper functions across
the workspace-server. Together with the CI fix to remove the
PHASE3_MASKED workaround, this should make CI/Platform (Go) stable.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>