Merge branch 'feat/oss-snap-clean-session' into test/oss-snap-head-guard

This commit is contained in:
pingqiu committed 2026-11-24 12:43:47 -08:00
commit 288c5f76f7
1 file changed
+18 -19
@@ -96,25 +96,24 @@ func TestClean_ExcludesSnapshot(t *testing.T) {
}
}
func TestCleanSession_InterruptAtEveryStep(t *testing.T) {
t.Run("BeginClean", func(t *testing.T) {
interruptHead(t, idleHead(), func(st HeadStore) error {
_, err := RunBeginClean(context.Background(), st, me, "c1")
return err
}, func(t *testing.T, h Head) {
if h.Activity != (Activity{Kind: ActClean, Session: "c1"}) {
t.Fatalf("HEAD after BeginClean: %+v", h.Activity)
}
})
func TestRunBeginClean_InterruptAtEveryStep(t *testing.T) {
interruptHead(t, idleHead(), func(st HeadStore) error {
_, err := RunBeginClean(context.Background(), st, me, "c1")
return err
}, func(t *testing.T, h Head) {
if h.Activity != (Activity{Kind: ActClean, Session: "c1"}) {
t.Fatalf("HEAD after BeginClean: %+v", h.Activity)
}
})
t.Run("EndClean", func(t *testing.T) {
interruptHead(t, cleanHead("c1"), func(st HeadStore) error {
_, err := RunEndClean(context.Background(), st, me, "c1")
return err
}, func(t *testing.T, h Head) {
if h.Activity != (Activity{Kind: ActIdle}) {
t.Fatalf("HEAD after EndClean: %+v", h.Activity)
}
})
}
func TestRunEndClean_InterruptAtEveryStep(t *testing.T) {
interruptHead(t, cleanHead("c1"), func(st HeadStore) error {
_, err := RunEndClean(context.Background(), st, me, "c1")
return err
}, func(t *testing.T, h Head) {
if h.Activity != (Activity{Kind: ActIdle}) {
t.Fatalf("HEAD after EndClean: %+v", h.Activity)
}
})
}