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

chore: waits for a specific height instead of sleeping in the test for the emptiness of the first block #2284

Closed
wants to merge 45 commits into from
Closed
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
dc09be2
adds a utility function to update commit timeout in the default config
staheri14 Aug 6, 2023
0817d49
implements a test for inclusion of txs in the first block
staheri14 Aug 6, 2023
d6e03bc
renames the test suite
staheri14 Aug 6, 2023
99426a6
explains why the test fails
staheri14 Aug 6, 2023
585da49
revises a wrong value in the comments
staheri14 Aug 7, 2023
8bf0e01
fixes linter complaints
staheri14 Aug 7, 2023
64d0ab9
Merge remote-tracking branch 'origin/main' into sanaz/delay-block-pro…
staheri14 Aug 7, 2023
987ccd8
Merge remote-tracking branch 'origin/main' into sanaz/delay-block-pro…
staheri14 Aug 7, 2023
4a29d4f
renames CommitTimeout to TimeoutCommit
staheri14 Aug 8, 2023
012294b
Merge remote-tracking branch 'origin/main' into sanaz/delay-block-pro…
staheri14 Aug 8, 2023
cdd2c51
Merge branch 'main' into sanaz/delay-block-production
staheri14 Aug 8, 2023
3c86d01
updates timeout_commit to 10 to fix the race failure
staheri14 Aug 8, 2023
951fb11
Merge branch 'main' into sanaz/delay-block-production
staheri14 Aug 8, 2023
124bb20
updates a comment to clarify that the height 1 is not started
staheri14 Aug 8, 2023
c1aa8a8
Merge branch 'main' into sanaz/delay-block-production
staheri14 Aug 8, 2023
17979e8
addresses comments
staheri14 Aug 9, 2023
013d8dd
Merge remote-tracking branch 'origin/main' into sanaz/delay-block-pro…
staheri14 Aug 9, 2023
ebb5227
explains the purpose of the test
staheri14 Aug 9, 2023
2b436b6
checks the block height before filtering txs
staheri14 Aug 9, 2023
5f25148
refactors the code
staheri14 Aug 9, 2023
2affc82
extends the test by verifying that the second block is non-empty
staheri14 Aug 9, 2023
007a61e
wraps lines to 80 chars
staheri14 Aug 9, 2023
399e655
fixes linter problem
staheri14 Aug 9, 2023
cd4686e
fixes more linter related issues
staheri14 Aug 9, 2023
f522b3f
Merge branch 'main' into sanaz/block-height-check-prepareproposal
staheri14 Aug 9, 2023
9ee34c8
edits a comment
staheri14 Aug 9, 2023
a818d13
revises comments
staheri14 Aug 9, 2023
9bd0873
clarifies why should we wait for timeout commit
staheri14 Aug 9, 2023
f11cdd4
Revert "fixes more linter related issues"
staheri14 Aug 9, 2023
93692c5
adresses comments
staheri14 Aug 14, 2023
bdd3cf0
Merge remote-tracking branch 'origin/main' into sanaz/block-height-ch…
staheri14 Aug 14, 2023
33be5cb
Merge branch 'main' into sanaz/block-height-check-prepareproposal
staheri14 Aug 14, 2023
969fbbe
Merge remote-tracking branch 'origin/main' into sanaz/block-height-ch…
staheri14 Aug 14, 2023
7c6b3fa
Merge remote-tracking branch 'origin/main' into sanaz/block-height-ch…
staheri14 Aug 15, 2023
7ffd4eb
waits for a specific height instead of sleeping
staheri14 Aug 15, 2023
91f0f56
Merge remote-tracking branch 'origin/main' into sanaz/waits-for-heigh…
staheri14 Aug 15, 2023
85fa9b6
fixes a typo
staheri14 Aug 15, 2023
db89ace
fixes race condition
staheri14 Aug 15, 2023
0ff420c
waits for height 1 with default timeout
staheri14 Aug 15, 2023
0247e73
Merge branch 'main' into sanaz/waits-for-height-in-block-production-test
staheri14 Sep 15, 2023
ee9ca9b
removes some unused parts of the code, and uses WaitWithTimeout method
staheri14 Oct 2, 2023
1f18e3d
Merge remote-tracking branch 'origin/main' into sanaz/waits-for-heigh…
staheri14 Oct 2, 2023
d125f44
Merge branch 'main' into sanaz/waits-for-height-in-block-production-test
staheri14 Oct 2, 2023
91eb587
changes broadcast type to async
staheri14 Oct 2, 2023
adca503
revert back to BroadcastBlock
staheri14 Oct 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/test/block_production_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ func (s *BlockProductionTestSuite) Test_FirstBlockIsEmpty() {
require := s.Require()
// wait until height 1 before posting transactions
// otherwise tx submission will fail
time.Sleep(1 * s.timeoutCommit)
// send some transactions, these should be included in the second block
_, err := s.cctx.PostData(s.accounts[0], flags.BroadcastBlock, appns.RandomBlobNamespace(), tmrand.Bytes(100000))
_, err := s.cctx.WaitForHeightWithTimeout(1, s.timeoutCommit)
require.NoError(err)
// send a transaction, it should be included in the second block
_, err = s.cctx.PostData(s.accounts[0], flags.BroadcastBlock, appns.RandomBlobNamespace(), tmrand.Bytes(100000))
require.NoError(err)

// wait for 2*s.timeoutCommit+1*time.Second to ensure that the node is
// at height 2
_, err = s.cctx.WaitForHeightWithTimeout(2, 2*s.timeoutCommit+1*time.Second)
// wait for height 2
_, err = s.cctx.WaitForHeightWithTimeout(2, s.timeoutCommit)
require.NoError(err)

// fetch the first block
Expand Down
Loading