Skip to content

Commit 77b960a

Browse files
committed
test(artifact): document serial test constraints
Most artifact tests now run in parallel, so the few intentional exceptions are easy to mistake for omissions. Record the process-global state each relies on to prevent future cleanup from making them unsafe or flaky.
1 parent c5432bf commit 77b960a

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

internal/artifact/export_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,7 @@ func TestLatestValidCheckpointFallsBackPastSemanticCandidateAndDefersFuture(t *t
10731073
}
10741074

10751075
func TestExportSpoolConstructionJoinsCleanupFailures(t *testing.T) {
1076+
// Serial: overrides package-level spool filesystem hooks.
10761077
chmodFailure := errors.New("injected spool setup failure")
10771078
cleanupFailure := errors.New("injected spool cleanup failure")
10781079
previousChmod := exportSpoolChmod

internal/artifact/import_checkpoint_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ func TestDecodeImportCheckpointBoundsTopLevelFieldState(t *testing.T) {
515515
}
516516

517517
func TestPreflightImportCheckpointVersionBoundsAllocations(t *testing.T) {
518+
// Serial: AllocsPerRun measures process-global allocation state.
518519
const sessionCount = 1_000
519520
var body strings.Builder
520521
fmt.Fprintf(&body, `{"origin":%q,"seq":7,"sessions":{`, contractOrigin)
@@ -544,6 +545,7 @@ func TestPreflightImportCheckpointVersionBoundsAllocations(t *testing.T) {
544545
func TestDecodeImportCheckpointRejectsCurrentExtraFieldBeforeItsValue(
545546
t *testing.T,
546547
) {
548+
// Serial: AllocsPerRun measures process-global allocation state.
547549
var body strings.Builder
548550
body.WriteString(`{"v":1,"extra":{`)
549551
for i := range 10_000 {

internal/artifact/repository_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func TestOpenRepositoryFollowsFinalRootSymlink(t *testing.T) {
101101
}
102102

103103
func TestOpenRepositoryRetainsAbsoluteCanonicalRoot(t *testing.T) {
104+
// Serial: Chdir changes the process-wide working directory.
104105
dataDir := t.TempDir()
105106
// Chdir to the temp dir's parent so the relative path stays on one
106107
// volume; on Windows CI the checkout and temp dirs are on different

internal/artifact/wire_codec_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ func TestWireCodecStreamsMultiMegabyteArtifactsWithBoundedBuffers(t *testing.T)
651651
}
652652

653653
func TestWireCodecAllocatedBytesStayBoundedAsArtifactsGrow(t *testing.T) {
654+
// Serial: Benchmark reads process-global allocation statistics.
654655
const (
655656
smallSize = int64(32 << 10)
656657
largeSize = int64(12 << 20)

0 commit comments

Comments
 (0)