Run snmpsim via uvx in isolated Python 3.11 environment#4009
Merged
Conversation
snmpsim has a severe performance regression on Python 3.13+ where the new `dbm.sqlite3` default backend causes every write during index building to fsync individually, resulting in ~25x slowdown. The `snmpsim` fixture now prefers running via `uvx --python=3.11` in an isolated environment. Falls back to a locally installed `snmpsim-command-responder` with a warning on Python 3.13+. Also detects premature process exit in the wait loop instead of spinning indefinitely.
Test results 3 files 3 suites 4m 18s ⏱️ Results for commit 6b1abd3. ♻️ This comment has been updated with latest results. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4009 +/- ##
=======================================
Coverage 64.23% 64.23%
=======================================
Files 629 629
Lines 46669 46666 -3
Branches 43 43
=======================================
Hits 29978 29978
+ Misses 16681 16678 -3
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
johannaengland
approved these changes
May 13, 2026
johannaengland
left a comment
Contributor
There was a problem hiding this comment.
Just a nitpick about a function name
As suggested in review Co-authored-by: Johanna England <johanna.england@sikt.no>
lunkwill42
force-pushed
the
bugfix/snmpsim-uvx-python311
branch
from
May 18, 2026 08:28
81ab0ea to
6b1abd3
Compare
|
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.



Scope and purpose
snmpsim has a severe performance regression on Python 3.13+ where the new
dbm.sqlite3default backend causes every write during index building to fsync individually, resulting in ~25x slowdown (see pysnmp#223, snmpsim PR#10).The
snmpsimtest fixture now prefers running viauvx --python=3.11in an isolated environment. Falls back to a locally installedsnmpsim-command-responderwith a warning on Python 3.13+. Also detects premature process exit in the wait loop instead of spinning indefinitely.Note
If a fix lands upstream in snmpsim (e.g. snmpsim PR#10 is merged), we should revisit this and potentially remove the uvx/Python 3.11 workaround.
Contributor Checklist
Added a changelog fragment for towncrier(not user-facing)Added/changed documentation<major>.<minor>.x). For a new feature or other additions, it should be based onmaster.If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be doneIf it's not obvious from a linked issue, described how to interact with NAV in order for a reviewer to observe the effects of this change first-hand (commands, URLs, UI interactions)If this results in changes in the UI: Added screenshots of the before and afterIf this adds a new Python source code file: Added the boilerplate header to that file