Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The leak test is failing occasionally #20

Closed
tchap opened this issue Oct 1, 2015 · 3 comments
Closed

The leak test is failing occasionally #20

tchap opened this issue Oct 1, 2015 · 3 comments

Comments

@tchap
Copy link
Owner

tchap commented Oct 1, 2015

Not too cool, the tests should always return the same results.

$ go test
PASS
ok      github.com/tchap/go-patricia/patricia   4.871s
$ go test
PASS
ok      github.com/tchap/go-patricia/patricia   4.646s
$ go test
PASS
ok      github.com/tchap/go-patricia/patricia   4.584s
$ go test
PASS
ok      github.com/tchap/go-patricia/patricia   5.005s
$ go test
--- FAIL: TestTrie_DeleteLeakageDense (0.00s)
    patricia_dense_test.go:213: Size=0, Total=1, Trie state:
        ab <nil>

    patricia_dense_test.go:214: Heap space leak, grew from 106576 to 108672 bytes
FAIL
exit status 1
FAIL    github.com/tchap/go-patricia/patricia   4.463s
@tchap tchap changed the title The leak test if failing occasionally The leak test is failing occasionally Oct 1, 2015
@dmitris
Copy link
Contributor

dmitris commented Jun 21, 2016

I'm seeing consistent failures of TestTrie_DeleteLeakageDense:

$ go test
--- FAIL: TestTrie_DeleteLeakageDense (0.00s)
    patricia_dense_test.go:213: Size=0, Total=1, Trie state:
        ab <nil>

    patricia_dense_test.go:214: Heap space leak, grew from 126128 to 129888 bytes
--- FAIL: TestParticiaTrie_DeleteLeakageSparse (0.00s)
    patricia_sparse_test.go:444: Size=0, Total=1, Trie state:
         <nil>

    patricia_sparse_test.go:445: Heap space leak, grew from 133120 to 134928 bytes
FAIL
exit status 1
FAIL    github.com/tchap/go-patricia/patricia   4.197s

The test TestParticiaTrie_DeleteLeakageSparse fails occasionally (approximately 1 in 10 runs):

 --- FAIL: TestParticiaTrie_DeleteLeakageSparse (0.00s)
    patricia_sparse_test.go:444: Size=0, Total=1, Trie state:
         <nil>

    patricia_sparse_test.go:445: Heap space leak, grew from 133120 to 134928 bytes

I wonder if this is a real problem - I put the following loop around the DeleteLeakageSparse test, running insert/delete for 1M times:

for i := 0; i < 1000000; i++ {

and the whole "leak" was around 12900 bytes. Seems that the go runtime / GC retain some small part of memory... Can we put some reasonable limit like 15000 bytes and test the growth against that?

@tchap
Copy link
Owner Author

tchap commented Jun 24, 2016

I guess that we can close this for now, what do you think, @dmitris ?

@dmitris
Copy link
Contributor

dmitris commented Jun 27, 2016

sure - please feel free to close the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants