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

Explicitly set TestMode=0 in TestValidatorStateChange_OutputAddressEdit #1543

Merged

Conversation

msmania
Copy link
Contributor

@msmania msmania commented Apr 7, 2023

We cannot trust the current state as it may have been modified by previous tests and not reverted to the original value.

@reviewpad
Copy link

reviewpad bot commented Apr 7, 2023

AI-Generated Summary: This pull request includes a patch that explicitly sets TestMode=0 in the TestValidatorStateChange_OutputAddressEdit function. This ensures that the current state is not affected by previous tests, providing a more reliable test environment. The changes are made in the valStateChanges_test.go file with 3 lines added.

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Apr 7, 2023
@msmania msmania requested a review from Olshansk April 7, 2023 01:12
@msmania
Copy link
Contributor Author

msmania commented Apr 7, 2023

@msmania Seems like it's still failing: https://app.circleci.com/pipelines/github/pokt-network/pocket-core/2811/workflows/fdf09d63-cf8f-45a2-bb3f-4a1fc54d0a00/jobs/5260/parallel-runs/0/steps/0-102

Maybe adding a single test broke the testing order..? Probably the root cause is the same. Let's fix them all.

@msmania msmania force-pushed the toshi/testfix-TestValidatorStateChange_OutputAddressEdit branch from 0ac2276 to bf1b0a3 Compare April 7, 2023 19:41
@reviewpad
Copy link

reviewpad bot commented Apr 7, 2023

AI-Generated Summary: This pull request modifies two test files, reward_test.go and valStateChanges_test.go within the nodes/keeper directory. The changes mainly include the addition of test clean-up code that restores the global parameters to their original values after they have been modified by the tests. These clean-up functions are necessary to prevent unexpected test behavior or conflicts between different tests. A total of 49 new lines were added and 3 existing lines were modified.

@msmania
Copy link
Contributor Author

msmania commented Apr 7, 2023

All passed!

Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

Seems like through these reviews we have found a hack for global variables in tests when p=1 :)

@msmania msmania merged commit a33ee1b into staging Apr 8, 2023
@msmania msmania deleted the toshi/testfix-TestValidatorStateChange_OutputAddressEdit branch April 8, 2023 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Pull request is small waiting-for-review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants