From 99078466bb2849618c59b73fb6e72efbb57a8258 Mon Sep 17 00:00:00 2001 From: Wei Fu Date: Thu, 4 Jan 2024 14:40:21 +0800 Subject: [PATCH] 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 (cherry picked from commit 49eb212fa8ab67709ea460df01982504cf7fa4a1) Signed-off-by: Wei Fu --- tests/robustness/powerfailure_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/robustness/powerfailure_test.go b/tests/robustness/powerfailure_test.go index 35ed628b4..d8c497e0a 100644 --- a/tests/robustness/powerfailure_test.go +++ b/tests/robustness/powerfailure_test.go @@ -150,6 +150,7 @@ func doPowerFailure(t *testing.T, du time.Duration, fsType dmflakey.FSType, mkfs "-path", dbPath, "-count=1000000000", "-batch-size=5", // separate total count into multiple truncation + "-value-size=512", } 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 select { case <-time.After(10 * time.Second): - t.Error("bbolt should stop with panic in seconds") + t.Log("bbolt is supposed to be already stopped, but actually not yet; forcibly kill it") assert.NoError(t, cmd.Process.Kill()) case err := <-errCh: require.Error(t, err)