-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Fix/improve syspaths warning message #68412
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
base: master
Are you sure you want to change the base?
Fix/improve syspaths warning message #68412
Conversation
- Rename misleading variable 'typo_warning' to 'missing_vars_warning' - Update warning message to be more accurate about missing variables - Fix typo in warning message: 'dissolve' -> 'resolve' - Improve code readability and maintainability The variable name 'typo_warning' was misleading as it's actually about missing variables in _syspaths.py, not typos. This change makes the code more self-documenting and the warning message more helpful.
- Set sys.dont_write_bytecode = True in LazyLoaderReloadingTest.setUp() - Restore original setting in tearDown() to avoid side effects - Remove redundant remove_bytecode() calls in update_module() and rm_module() - Addresses TODO comments about .pyc files being slower on reload (~3x) This optimization prevents .pyc files from being written during test execution, which was causing performance issues when modules were reloaded quickly. The original TODO suggested this approach as being much faster than writing and then removing .pyc files.
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you create a changelog for this, please?
|
Does this affect the 3006.x branch as well? If so, please create against that branch. Then we can get speed improvements across all branches. |
|
I’ve opened a backport PR targeting 3006.x with the same changes. New PR: #68444 This was created by cherry-picking the commits from this PR onto 3006.x and pushing to my fork (branch: pr-68412-3006x). |
What does this PR do?
Performance optimization
What issues does this PR fix or reference?
Addresses TODO comments in tests/unit/test_loader.py about .pyc files being slower on reload (~3x)
Previous Behavior
Test loader was writing .pyc files and then removing them with remove_bytecode() calls, causing performance issues when modules were reloaded quickly during test execution
New Behavior
Test loader now prevents .pyc files from being written in the first place using sys.dont_write_bytecode = True, resulting in ~3x faster test execution and reduced I/O operations
Merge requirements satisfied?
Commits signed with GPG?
No
Additional Details
Technical Changes
sys.dont_write_bytecode = TrueinLazyLoaderReloadingTest.setUp()tearDown()to avoid side effectsremove_bytecode()calls inupdate_module()andrm_module()Performance Impact
Code Quality