Skip to content

Commit 9907846

Browse files
committed
tests/robustness: switch to kill if no panic after 10sec
If file doesn't grow in 10 sec, bbolt won't trigger the following errors: * lackOfDiskSpace * mapError * resizeFileError * unmapError We should switch to kill instead of waiting for panic. In order to trigger these errors, we should increase value size to 512. Signed-off-by: Wei Fu <fuweid89@gmail.com> (cherry picked from commit 49eb212) Signed-off-by: Wei Fu <fuweid89@gmail.com>
1 parent 1b38fb3 commit 9907846

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/robustness/powerfailure_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func doPowerFailure(t *testing.T, du time.Duration, fsType dmflakey.FSType, mkfs
150150
"-path", dbPath,
151151
"-count=1000000000",
152152
"-batch-size=5", // separate total count into multiple truncation
153+
"-value-size=512",
153154
}
154155

155156
logPath := filepath.Join(t.TempDir(), fmt.Sprintf("%s.log", t.Name()))
@@ -196,7 +197,7 @@ func doPowerFailure(t *testing.T, du time.Duration, fsType dmflakey.FSType, mkfs
196197

197198
select {
198199
case <-time.After(10 * time.Second):
199-
t.Error("bbolt should stop with panic in seconds")
200+
t.Log("bbolt is supposed to be already stopped, but actually not yet; forcibly kill it")
200201
assert.NoError(t, cmd.Process.Kill())
201202
case err := <-errCh:
202203
require.Error(t, err)

0 commit comments

Comments
 (0)