Fix pbts tests#7413
Conversation
|
Thanks for putting this up! I see the issue that is causing the tests that you have marked The corresponding line in the test harness is this one: tendermint/internal/consensus/pbts_test.go Line 154 in 8f204cf What is happening here is that we are now creating a different proposal in the test function than what the state machine is creating. The test is creating the block proposal here: tendermint/internal/consensus/pbts_test.go Line 151 in 8f204cf time.Now. This used to just construct the time using the data from the previous precommits, i.e. it was consistent across calls within the same height. This method is no longer consistent because a second call will produce a block with a different timestamp. One solution would be to add a tmtime.Source onto the package consensus's State struct so that we can control the time from within a test. This would mean adding a field to the struct and then initializing it with the DefaultSource in the normal case and with our test clock in tests.The other option is to not check the block ID from within the test since it's not entirely relevant to the test. I don't have a strong preference, but option 2 is likely simpler and adds less complexity. |
I just tried with option 2. The two pbts tests that are left are both failing at |
* Allow nil block ID check in ensureProposalWithTimout * William's suggestion to get the proposal from the proposer instead of generating it. * Remove error check on service stop
wb/proposer-based-timestampspbts tests are broken.