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 non-deterministic map iteration in fuzzer #2069

Merged
merged 4 commits into from
Aug 16, 2018

Conversation

ValarDragon
Copy link
Contributor

@ValarDragon ValarDragon commented Aug 16, 2018

  • Updated all relevant code comments - I think its clear?
  • Wrote tests

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Left two minor remarks @ValarDragon 👍

keys[i] = key
i++
}
return keys
Copy link
Contributor

Choose a reason for hiding this comment

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

Dont' we wanna do return strings.Sort(keys) here?

for _, mVal := range validators {
keys := getKeys(validators)

for i := 0; i < len(keys); i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just, for _, key := range getKeys(validators) { mVal := validators[key] }?

@@ -166,12 +168,14 @@ func TestAppStateDeterminism(t *testing.T) {
},
[]simulation.RandSetup{},
[]simulation.Invariant{noOpInvariant},
0,
Copy link
Contributor

Choose a reason for hiding this comment

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

We want these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so (changed to 20, 20 in latest commit). Earlier values were with the intention that this tests the framework, but as chris pointed out this would be valuable to test gaia itself.

@codecov
Copy link

codecov bot commented Aug 16, 2018

Codecov Report

Merging #2069 into release/v0.24.0 will increase coverage by 0.16%.
The diff coverage is n/a.

@@                 Coverage Diff                 @@
##           release/v0.24.0    #2069      +/-   ##
===================================================
+ Coverage            63.81%   63.97%   +0.16%     
===================================================
  Files                  113      113              
  Lines                 6665     6665              
===================================================
+ Hits                  4253     4264      +11     
+ Misses                2129     2118      -11     
  Partials               283      283

@ValarDragon
Copy link
Contributor Author

This should be good to merge now. The bug was a non-deterministic map iteration bug in the fuzzer, not the SDK itself. It has been fixed. Additionally the app determinism test now tests gaia itself, not just the randomized testing framework.

@ValarDragon ValarDragon changed the title WIP: debug nondeterminism Fix non-deterministic map iteration in fuzzer Aug 16, 2018
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

utACK, thanks

@cwgoes cwgoes merged commit 8bb79d1 into release/v0.24.0 Aug 16, 2018
@cwgoes cwgoes deleted the dev/debug_nondeterminism branch August 16, 2018 21:45
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.

3 participants