diff --git a/fuse/pressure_test.go b/fuse/pressure_test.go index e75250cbb3a9ec5ba2beebfa3e21309e149969c7..377373880b962bdf87b28e8e38cad665405ecdd8 100644 --- a/fuse/pressure_test.go +++ b/fuse/pressure_test.go @@ -54,11 +54,11 @@ func TestMemoryPressure(t *testing.T) { if err != nil { t.Fatalf("mount failed: %v", err) } + state.Debug = VerboseTest() + go state.Loop() defer state.Unmount() - state.Debug = VerboseTest() - // Wait for FS to get ready. os.Lstat(dir) @@ -75,7 +75,12 @@ func TestMemoryPressure(t *testing.T) { }(i) } time.Sleep(100 * time.Millisecond) + + state.reqMu.Lock() + bufs.lock.Lock() created := bufs.createdBuffers + state.outstandingReadBufs + bufs.lock.Unlock() + state.reqMu.Unlock() t.Logf("Have %d read bufs", state.outstandingReadBufs) if created > _MAX_READERS {