import Spec objects for each test case#2755
Closed
hwwhww wants to merge 1 commit intoex-ante-testsfrom
Closed
Conversation
3 tasks
ralexstokes
reviewed
Dec 7, 2021
| module = importlib.util.module_from_spec(module_spec) | ||
| loader = importlib.util.LazyLoader(module_spec.loader) | ||
| module_spec.loader = loader | ||
| import sys |
Member
There was a problem hiding this comment.
nitpick: hoist import sys to the top of the file
Contributor
Author
|
replaced by #2765 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
spec_configured_state_testis not thread-safe:spec: Specobject was initialized with globalspec_targetsincontext.py.spec_configured_state_testoverridesspec.config, execute the test case, and then change it back to the unchanged config.spec.configobject in other concurrent tasks might be changed too.Due to 1+2, #2752 failed because some of the ex-ante tests override
spec.config.PROPOSER_SCORE_BOOSTtemporarily, and then concurrently,test_proposer_boost_correct_headfailed because it wrongly used the overridden value.How did I fix it
To better isolate the test cases, it would be better to reduce the risk of these side effects. This PR tries to import
Specobjects for each test case. The solution was found from here and here.