1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Description: Fix raciness in TestResize
Give loop device time to detect size change before proceeding with the rest
of the test.
Author: Daniel Swarbrick <dswarbrick@debian.org>
Last-Update: 2022-10-03
--- a/btrfs_test.go
+++ b/btrfs_test.go
@@ -9,6 +9,7 @@ import (
"reflect"
"sort"
"testing"
+ "time"
)
const sizeDef = 256 * 1024 * 1024
@@ -254,6 +255,7 @@ func TestResize(t *testing.T) {
if err = os.Truncate(fname, newSize); err != nil {
t.Fatal(err)
}
+ time.Sleep(time.Second)
if err = btrfstest.Mount(mnt, fname); err != nil {
t.Fatal(err)
}
|