Commit 9836d614 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys Committed by Han-Wen Nienhuys

fs: increase the limit for TestFileFdLeak

The RELEASE opcode is asynchronous, so the next open() call may
execute before the RELEASE for the preceding one has completed. In
case of GOMAXPROCS=1, this happens often.

Increase the limit to 15 to reduce the chance of this causing a test
failure. The test runs 100 times, so this should still catch logic
errors with deallocating file handles.

Fixes #477.

Change-Id: I12dbd96b2a6082e0f4a386d35983e6efcc596aef
parent e5b78843
...@@ -163,7 +163,7 @@ func TestBasic(t *testing.T) { ...@@ -163,7 +163,7 @@ func TestBasic(t *testing.T) {
func TestFileFdLeak(t *testing.T) { func TestFileFdLeak(t *testing.T) {
tc := newTestCase(t, &testOptions{ tc := newTestCase(t, &testOptions{
suppressDebug: true, suppressDebug: false,
attrCache: true, attrCache: true,
entryCache: true, entryCache: true,
}) })
...@@ -174,8 +174,9 @@ func TestFileFdLeak(t *testing.T) { ...@@ -174,8 +174,9 @@ func TestFileFdLeak(t *testing.T) {
bridge := tc.rawFS.(*rawBridge) bridge := tc.rawFS.(*rawBridge)
tc = nil tc = nil
if got := len(bridge.files); got > 3 { // posixtest.FdLeak also uses 15 as a limit.
t.Errorf("found %d used file handles, should be <= 3", got) if got, want := len(bridge.files), 15; got > want {
t.Errorf("found %d used file handles, should be <= %d", got, want)
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment