test(settings): shorten hard-link save stress test (#630)

This commit is contained in:
TryWorld authored and GitHub committed 2026-10-03 12:51:45 +08:00
1 parent 48c496d049
commit c90e66f7bb
1 file changed
+6 -1
+6 -1
View File
@@ -63,12 +63,17 @@ func testSaveConcurrent(t *testing.T, linked bool) {
} else {
close(readDone)
}
iterations := 300
if linked {
// Each hard-link save syncs the file; fewer writes keep this test quick.
iterations = 50
}
start := make(chan struct{})
var wg sync.WaitGroup
for range 8 {
wg.Go(func() {
<-start
for i := range 300 {
for i := range iterations {
s := Load()
check(s)
s.NoAutoUpdate = i%2 == 0