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

Avoid changing t in randomized_dag_copy() by shallow copying #260

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

kemzeb
Copy link
Collaborator

@kemzeb kemzeb commented Jul 14, 2023

Resolves #256.

After doing some bisecting and running the testing code using the randomly plugin, I found that the problem lies here:

random.shuffle(randomized_nodes)

randomized_dag_copy() ends up modifying the global variable t when it shuffles the list of ReqPackages associated to a DistPackage.

This CL fixes this by just shallow copying the list.

`randomized_dag_copy()` ends up modifying the global variable `t`
when it shuffles the required package list associated to a
`DistPackage`.

This CL fixes this by just shallow copying the list.
@kemzeb kemzeb changed the title Avoid changing t in randomized_dag_copy() by shadow copying Avoid changing t in randomized_dag_copy() by shallow copying Jul 14, 2023
Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

@gaborbernat gaborbernat merged commit 9507f19 into tox-dev:main Jul 14, 2023
@kemzeb kemzeb deleted the fix/tests branch July 14, 2023 22:33
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.

test_package_dag_filter sometimes fails
2 participants