File: 01-fix-racy-test.patch

package info (click to toggle)
golang-github-dennwc-btrfs 0.0~git20221026.3097362-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 312 kB
  • sloc: makefile: 4; sh: 4
file content (23 lines) | stat: -rw-r--r-- 575 bytes parent folder | download
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)
 	}