mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
Merge branch 'feat/oss-snap-clean-session' into test/oss-snap-head-guard
This commit is contained in:
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user