mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Deflake gofer_test.
We must wait for all lazy resources to be released before closing the rootFile. PiperOrigin-RevId: 226419499 Change-Id: I1d4d961a92b3816e02690cf3eaf0a88944d730cc
This commit is contained in:
committed by
Shentubot
parent
f6274804e1
commit
8ba450363f
@@ -68,7 +68,13 @@ func rootTest(t *testing.T, name string, cp cachePolicy, fn func(context.Context
|
||||
// Ensure that the cache is fully invalidated, so that any
|
||||
// close actions actually take place before the full harness is
|
||||
// torn down.
|
||||
defer m.FlushDirentRefs()
|
||||
defer func() {
|
||||
m.FlushDirentRefs()
|
||||
|
||||
// Wait for all resources to be released, otherwise the
|
||||
// operations may fail after we close the rootFile.
|
||||
fs.AsyncBarrier()
|
||||
}()
|
||||
|
||||
// Execute the test.
|
||||
fn(ctx, h, root, rootInode)
|
||||
|
||||
Reference in New Issue
Block a user