* eth/fetcher: fix test to avoid hanging. Partial fix for #23331 * eth/filters: avoid dangling goroutines * eth/fetcher: revert closing of proceed
This commit is contained in:
1 parent
3b967d16ca
commit
7175f82495
2 files changed
+17
-5
No files matched your search
@@ -304,7 +304,6 @@ func TestTransactionFetcherSingletonRequesting(t *testing.T) {
|
||||
func TestTransactionFetcherFailedRescheduling(t *testing.T) {
|
||||
// Create a channel to control when tx requests can fail
|
||||
proceed := make(chan struct{})
|
||||
|
||||
testTransactionFetcherParallel(t, txFetcherTest{
|
||||
init: func() *TxFetcher {
|
||||
return NewTxFetcher(
|
||||
@@ -1263,6 +1262,16 @@ func testTransactionFetcher(t *testing.T, tt txFetcherTest) {
|
||||
fetcher.Start()
|
||||
defer fetcher.Stop()
|
||||
|
||||
defer func() { // drain the wait chan on exit
|
||||
for {
|
||||
select {
|
||||
case <-wait:
|
||||
default:
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
// Crunch through all the test steps and execute them
|
||||
for i, step := range tt.steps {
|
||||
switch step := step.(type) {
|
||||
|
||||
Reference in new issue
Block a user