diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index dd01c08f539e..2ee240d398b4 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -404,6 +404,9 @@ func testTransactionInBlockInterrupted(t *testing.T, client *rpc.Client) { // Test tx in block interupted. ctx, cancel := context.WithCancel(context.Background()) cancel() + if ctx.Err() != context.Canceled { + t.Fatal("context is not canceled") + } tx, err := ec.TransactionInBlock(ctx, block.Hash(), 0) if tx != nil { t.Fatal("transaction should be nil")