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-determinism issues with deep-mind logger in tests #383

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

arhag
Copy link
Member

@arhag arhag commented Jun 14, 2022

Added an updatable configuration to deep_mind_handler to support special adjusted behavior for the deep mind logger to be used specifically in the context of tests.

In particular a new config flag called zero_elapsed is added to this config which if set to true will first zero out the elapsed fields within a copy of the transaction trace before writing it out to the logs.

The zero_elapsed flag is set to true in the deep_mind_tests in order to guarantee a deterministically generated log to compare against the committed log. This appears to be a more reliable solution to avoiding non-determinism in the tests than relying on the auto-generated [[:xdigit:]] masks in the committed logs. It may now be reasonable to greatly simply that log merge and comparison logic, but that is not addressed in this PR.

Added an updated configuration `deep_mind_handler` to support
special adjusted behavior for the deep mind logger to be used
specifically in the context of tests.

In particular a new config flag called `zero_elapsed` is added to this
config which if set to true will first zero out the `elapsed` fields
within a copy of the transaction trace before writing it out to the
logs.

The `zero_elapsed` flag is set to true in the deep_mind_tests in order
to guarantee a deterministically generated log to compare against the
committed log. This appears to be a more reliable solution to avoiding
non-determinism in the tests than relying on the auto-generated
`[[:xdigit:]]` masks in the committed logs. It may now be reasonable
to greatly simply that log merge and comparison logic, but that is not
addressed in this commit.
arhag added a commit to elmato/mandel that referenced this pull request Jun 14, 2022
@arhag arhag merged commit bc08f6d into main Jun 14, 2022
@arhag arhag deleted the arhag/reproducible-deep-mind branch June 14, 2022 23:39
linh2931 added a commit that referenced this pull request Jul 3, 2022
…h straight-forward file saving and comparison, made possible by PR #383's fix of non-determinism of deep-mind logger
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.

2 participants