Skip to content
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

fix: itest: fix eth deploy test flake #10829

Merged
merged 1 commit into from
May 5, 2023
Merged

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented May 4, 2023

Related Issues

fixes #10824

Proposed Changes

This fixes the TestDeployment flakiness by:

  1. Pause mining before submitting the message. That way, we force it to get stuck in the message pool.
  2. Removing the logic that asks lotus for the "latest" block. We have other tests that exercise "latest".

@Stebalien Stebalien requested a review from a team as a code owner May 4, 2023 19:45
@Stebalien
Copy link
Member Author

(validated by reducing the block times back to 100ms and ensuring that the test still passes)

@Stebalien Stebalien requested a review from arajasek May 4, 2023 19:46
@@ -93,6 +87,15 @@ func TestDeployment(t *testing.T) {
pendingFilter, err := client.EthNewPendingTransactionFilter(ctx)
require.NoError(t, err)

// Disconnect peers so we can send messages without propegating them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work, but is it need easier to just pause and resume mining?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

This fixes the flakyness by:

1. Disconnecting the client from the miner before submitting the
message. That way, we force it to get stuck in the message pool.
2. Removing the logic that asks lotus for the "latest" block. We have
other tests that exercise "latest".

fixes #10824
@snissn
Copy link
Contributor

snissn commented May 5, 2023

@Stebalien
Copy link
Member Author

Nope, that's intentional:

// should return error with non-existent block hash
nonExistentHash, err := ethtypes.ParseEthHash("0x62a80aa9262a3e1d3db0706af41c8535257b6275a283174cabf9d108d8946059")
require.Nil(t, err)
_, err = client.EthGetBlockByHash(ctx, nonExistentHash, false)
require.NotNil(t, err)

(not sure why that's a part of the test, but it is)

@@ -93,6 +88,11 @@ func TestDeployment(t *testing.T) {
pendingFilter, err := client.EthNewPendingTransactionFilter(ctx)
require.NoError(t, err)

// Pause so we can test that everything works while the message is in the message pool.
for _, miner := range miners {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should just be the one miner because EnsembleMinimal, but I'm good with this.

@arajasek arajasek merged commit 9ae4292 into master May 5, 2023
@arajasek arajasek deleted the steb/fix-deploy-flake branch May 5, 2023 13:58
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.

Deflake TestDeployment test
3 participants