Skip to content

ethclient: fix the transaction in block testcase #28583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

minh-bq
Copy link
Contributor

@minh-bq minh-bq commented Nov 22, 2023

We observe failure in TestEthClient/TxInBlockInterrupted which can be reproduced by

go test -test.v -run=^TestEthClient/TxInBlockInterrupted --count=100

=== RUN   TestEthClient/TxInBlockInterrupted
    ethclient_test.go:399: transaction should be nil
--- FAIL: TestEthClient (0.03s)

This commit removes this part of testcase where the context is canceled before the client call and expects to get the context canceled error. It is because the client does not guarantee to prioritize context check before client call. This commit also adds some checks by use client.TransactionInBlock to query transactions in test block.

We observe failure in TestEthClient/TxInBlockInterrupted which can be reproduced by

	go test -test.v -run=^TestEthClient/TxInBlockInterrupted --count=100

	=== RUN   TestEthClient/TxInBlockInterrupted
	    ethclient_test.go:399: transaction should be nil
	--- FAIL: TestEthClient (0.03s)

This commit removes this part of testcase where the context is canceled before
the client call and expects to get the context canceled error. It is because the
client does not guarantee to prioritize context check before client call. This
commit also adds some checks by use client.TransactionInBlock to query
transactions in test block.
@minh-bq
Copy link
Contributor Author

minh-bq commented Nov 22, 2023

Oh, I didn't realize that there is a PR working on this already: #28283. So I will close this PR.

@minh-bq minh-bq closed this Nov 22, 2023
@minh-bq minh-bq deleted the fix/ethclient-txinblock branch November 22, 2023 11:29
@fjl
Copy link
Contributor

fjl commented Nov 22, 2023

Yeah, I added the changes there after the conversation on your earlier PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants