Skip to content

Commit

Permalink
eth/filters: avoid dangling goroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Nov 1, 2021
1 parent 538246b commit b75dc45
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions eth/filters/filter_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,15 @@ func TestLogFilterCreation(t *testing.T) {
)

for i, test := range testCases {
_, err := api.NewFilter(test.crit)
if test.success && err != nil {
id, err := api.NewFilter(test.crit)
if err != nil && test.success {
t.Errorf("expected filter creation for case %d to success, got %v", i, err)
}
if !test.success && err == nil {
t.Errorf("expected testcase %d to fail with an error", i)
if err == nil {
api.UninstallFilter(id)
if !test.success {
t.Errorf("expected testcase %d to fail with an error", i)
}
}
}
}
Expand Down

0 comments on commit b75dc45

Please sign in to comment.