Skip to content

Commit 6893d53

Browse files
Darioush Jalaligballet
authored andcommitted
eth/filters: prevent concurrent access in test (ethereum#30401)
use a mutex to prevent concurrent access to the api.filters map during `TestPendingTxFilterDeadlock` test
1 parent b3c496b commit 6893d53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

eth/filters/filter_system_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ func TestPendingTxFilterDeadlock(t *testing.T) {
601601
subs := make([]*Subscription, 20)
602602
for i := 0; i < len(subs); i++ {
603603
fid := api.NewPendingTransactionFilter(nil)
604+
api.filtersMu.Lock()
604605
f, ok := api.filters[fid]
606+
api.filtersMu.Unlock()
605607
if !ok {
606608
t.Fatalf("Filter %s should exist", fid)
607609
}

0 commit comments

Comments
 (0)