Skip to content

Commit

Permalink
ignore false-alarm "leak" from leveldb
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger committed Jan 20, 2025
1 parent c50e6ba commit 3d4e7b5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ethclient/simulated/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,21 @@ func TestCheckSimBackendGoroutineLeak(t *testing.T) {

l := leaks(stacks1, stacks2)
if len(l) > 0 {
// ignore this "leak" from leveldb: After closing the db, LevelDB takes about a second to close a go-routine
// that it instantiates.
re, err := regexp.Compile("github\\.com/syndtr/goleveldb/leveldb\\.\n.*/leveldb/db_state\\.go:110 \\+0xe4\ncreated by github\\.com/syndtr/goleveldb/leveldb\\.openDB in goroutine xxx\n.*/leveldb/db\\.go:149 \\+0x3d0")
if err != nil {
panic(err)
}
var leakedGRs string
for _, leak := range l {
if re.MatchString(leak) {
continue
}
leakedGRs = leakedGRs + fmt.Sprintf("%s\n\n", leak)
}

t.Fatalf("leaked goroutines:\n%s", leakedGRs)
if leakedGRs != "" {
t.Fatalf("leaked goroutines:\n%s", leakedGRs)
}
}
}

0 comments on commit 3d4e7b5

Please # to comment.