From 017fe52f7b36e0258a4f4377e95b27b3927239d1 Mon Sep 17 00:00:00 2001 From: Rin Date: Sun, 11 Jan 2026 13:01:03 +0700 Subject: [PATCH] Revert unrelated test fixes --- ethclient/gethclient/gethclient_test.go | 33 ++++++------------------- p2p/discover/v5_udp_test.go | 5 ---- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/ethclient/gethclient/gethclient_test.go b/ethclient/gethclient/gethclient_test.go index b6432e112d..0eed63cacf 100644 --- a/ethclient/gethclient/gethclient_test.go +++ b/ethclient/gethclient/gethclient_test.go @@ -413,19 +413,11 @@ func testSubscribePendingTransactions(t *testing.T, client *rpc.Client) { // Subscribe to Transactions ch1 := make(chan common.Hash) - sub1, err := ec.SubscribePendingTransactions(context.Background(), ch1) - if err != nil { - t.Fatalf("subscribe pending txs failed: %v", err) - } - defer sub1.Unsubscribe() + ec.SubscribePendingTransactions(context.Background(), ch1) // Subscribe to Transactions ch2 := make(chan *types.Transaction) - sub2, err := ec.SubscribeFullPendingTransactions(context.Background(), ch2) - if err != nil { - t.Fatalf("subscribe full pending txs failed: %v", err) - } - defer sub2.Unsubscribe() + ec.SubscribeFullPendingTransactions(context.Background(), ch2) // Send a transaction chainID, err := ethcl.ChainID(context.Background()) @@ -453,23 +445,14 @@ func testSubscribePendingTransactions(t *testing.T, client *rpc.Client) { t.Fatal(err) } // Check that the transaction was sent over the channel - select { - case hash := <-ch1: - if hash != signedTx.Hash() { - t.Fatalf("Invalid tx hash received, got %v, want %v", hash, signedTx.Hash()) - } - case err := <-sub1.Err(): - t.Fatalf("subscription 1 error: %v", err) + hash := <-ch1 + if hash != signedTx.Hash() { + t.Fatalf("Invalid tx hash received, got %v, want %v", hash, signedTx.Hash()) } - // Check that the transaction was sent over the channel - select { - case tx := <-ch2: - if tx.Hash() != signedTx.Hash() { - t.Fatalf("Invalid tx hash received, got %v, want %v", tx.Hash(), signedTx.Hash()) - } - case err := <-sub2.Err(): - t.Fatalf("subscription 2 error: %v", err) + tx = <-ch2 + if tx.Hash() != signedTx.Hash() { + t.Fatalf("Invalid tx hash received, got %v, want %v", tx.Hash(), signedTx.Hash()) } } diff --git a/p2p/discover/v5_udp_test.go b/p2p/discover/v5_udp_test.go index fec4d98991..6abe20d7a4 100644 --- a/p2p/discover/v5_udp_test.go +++ b/p2p/discover/v5_udp_test.go @@ -49,11 +49,6 @@ func TestUDPv5_lookupE2E(t *testing.T) { var cfg Config if len(nodes) > 0 { bn := nodes[0].Self() - // Wait for bootnode to have a valid UDP port (fix for flaky test) - for j := 0; j < 50 && bn.UDP() == 0; j++ { - time.Sleep(10 * time.Millisecond) - bn = nodes[0].Self() - } cfg.Bootnodes = []*enode.Node{bn} } node := startLocalhostV5(t, cfg)