-
Notifications
You must be signed in to change notification settings - Fork 33
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: unit tests in consensus, p2p and persistence modules #474
Conversation
@Prajjawalk The changes LGTM. Two things:
|
Yes @Olshansk , I have reviewed unit tests of all modules. |
@Prajjawalk The PR looks good to me, but our team (cc @okdas) is trying to figure out why the tests fail locally but pass in the CI.
--- a/persistence/test/state_test.go
+++ b/persistence/test/state_test.go
@@ -48,9 +48,9 @@ func TestStateHash_DeterministicStateWhenUpdatingAppStake(t *testing.T) {
// that the business logic doesn't change and that they remain deterministic. Anytime the business
// logic changes, these hashes will need to be updated based on the test output.
stateHashes := []string{
- "d719c5e760529556095dc683b1d146f02743babdd11c6c9d5f630c18de031d8b",
- "90b0554a8b87f823bb3ab91bf5bffe94deb7b05dafc4a7a6072ccd39c04a70e2",
- "486dab2407ea4817fd1ad35113fbb52604c9c95e6155517c7466663f5de33f0e",
+ "855f415b61748de482e3a547a4c88dd68fce23ca604884bc37881246c07988c6",
+ "8b874d45c555770b2eb90f0b00b3dca1b9f98e3785cffa2d9e7642379cb07ae7",
+ "0ddfd05a6dcb205c8c946e44847071e583f8c6ddd0757bc55b11b5200c34856f",
}
stakeAmount := initialStakeAmount |
@Olshansk Without making the proposed change the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We identified the root cause of the issue in #472 so this lgtm!
Description
This PR fixes all the unit test functions in all modules where actual and expected values were misplaced in
require.Equal
check.Issue
Fixes #241
Type of change
Please mark the relevant option(s):
List of changes
TestHotstuff4Nodes1BlockHappyPath
misplacement of actual and expected values inrequire.Equal
.TestRainTreeAddrBookUtilsHandleUpdate
andtestRainTreeMessageTargets
to correct incorrect expected and actual value placements.TestGetAppPauseHeightIfExists
,TestGetAppOutputAddress
,TestGetFishermanStatus
,TestGetFishermanPauseHeightIfExists
,TestGetFishermanOutputAddress
,TestPersistenceContextParallelReadWrite
,TestGetServiceNodePauseHeightIfExists
,TestGetServiceNodeOutputAddress
,fuzzSingleProtocolActor
,TestGetValidatorPauseHeightIfExists
, andTestGetValidatorOutputAddress
for misplaced expected and actual values inrequire.Equal
.TestUtilityContext_SetPoolAmount
,TestUtilityContext_GetMessageEditStakeSignerCandidates
,TestUtilityContext_GetMessageUnpauseSignerCandidates
,TestUtilityContext_GetMessageUnstakeSignerCandidates
, andTestUtilityContext_UnstakePausedBefore
to correct misplaced expected and actual values in require.Equal.Testing
make develop_test
README
Required Checklist
If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)