| 1 |
From: Daniel Swarbrick <[email protected]> |
| 2 |
Date: Mon, 3 Oct 2022 17:25:08 +0200 |
| 3 |
Subject: Fix raciness in TestResize |
| 4 |
|
| 5 |
Last-Update: 2022-10-03 |
| 6 |
|
| 7 |
Give loop device time to detect size change before proceeding with the rest |
| 8 |
of the test. |
| 9 |
--- |
| 10 |
btrfs_test.go | 2 ++ |
| 11 |
1 file changed, 2 insertions(+) |
| 12 |
|
| 13 |
diff --git a/btrfs_test.go b/btrfs_test.go |
| 14 |
index f31b9c4..d357242 100644 |
| 15 |
--- a/btrfs_test.go |
| 16 |
+++ b/btrfs_test.go |
| 17 |
@@ -9,6 +9,7 @@ import ( |
| 18 |
"reflect" |
| 19 |
"sort" |
| 20 |
"testing" |
| 21 |
+ "time" |
| 22 |
) |
| 23 |
|
| 24 |
const sizeDef = 256 * 1024 * 1024 |
| 25 |
@@ -254,6 +255,7 @@ func TestResize(t *testing.T) { |
| 26 |
if err = os.Truncate(fname, newSize); err != nil { |
| 27 |
t.Fatal(err) |
| 28 |
} |
| 29 |
+ time.Sleep(time.Second) |
| 30 |
if err = btrfstest.Mount(mnt, fname); err != nil { |
| 31 |
t.Fatal(err) |
| 32 |
} |