diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index efeab58d7df3..87971d5a97c9 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -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) + } } } }