Skip to content

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Jul 29, 2023

The test creates a temporary directory to store the modules every time it executes. However, with --forever, the test will run more than once. When the old directory got removed, the cached module would lost source. In order to fix this, we can simply remove the module from sys.modules and force the module to be reloaded every time.

Copy link
Member

@Eclips4 Eclips4 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!
Just FYI, I've found it via running refleak tests with 3:3 option. Probably, it's has the same mechanism of running tests as the --forever parameter.

@kumaraditya303 kumaraditya303 enabled auto-merge (squash) August 3, 2023 14:36
@kumaraditya303 kumaraditya303 merged commit 14fbd4e into python:main Aug 3, 2023
@gaogaotiantian gaogaotiantian deleted the fix-test-inspect branch August 3, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants