Skip to content

fix(test): parse baddns submodule source from file (Py 3.13+ fix)#3069

Merged
TheTechromancer merged 1 commit intodevfrom
fix-baddns-test-py313
May 1, 2026
Merged

fix(test): parse baddns submodule source from file (Py 3.13+ fix)#3069
TheTechromancer merged 1 commit intodevfrom
fix-baddns-test-py313

Conversation

@liquidsec
Copy link
Copy Markdown
Contributor

Summary

  • test_baddns_max_severity_confidence failed on Python 3.13/3.14 because inspect.getsource(cls) returned a single indented attribute line (e.g. description = "..."), which ast.parse rejected with IndentationError. CPython 3.13's source-block heuristics regressed for that class.
  • Each baddns submodule is exactly one class per file, so reading the whole file via inspect.getsourcefile() is equivalent and avoids the inspect.getsource heuristic entirely.
  • Verified passing on 3.12, 3.13, and 3.14 locally.

Failure context: https://github.com/blacklanternsecurity/bbot/actions/runs/24939288537/job/73030154357

inspect.getsource(cls) relies on linecache heuristics that mis-anchor
on Python 3.13+ and can return a single indented attribute line, which
ast.parse rejects with IndentationError. Read the whole source file
instead — each baddns submodule is one class per file.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

📊 Performance Benchmark Report

Comparing dev (baseline) vs fix-baddns-test-py313 (current)

📈 Detailed Results (All Benchmarks)

📋 Complete results for all benchmarks - includes both significant and insignificant changes

🧪 Test Name 📏 Base 📏 Current 📈 Change 🎯 Status
Bloom Filter Dns Mutation Tracking Performance 4.16ms 4.22ms +1.3%
Bloom Filter Large Scale Dns Brute Force 17.48ms 17.58ms +0.6%
Large Closest Match Lookup 360.27ms 350.92ms -2.6%
Realistic Closest Match Workload 192.90ms 189.17ms -1.9%
Event Memory Medium Scan 1784 B/event 1782 B/event -0.1%
Event Memory Large Scan 1768 B/event 1768 B/event +0.0%
Event Validation Full Scan Startup Small Batch 412.36ms 411.34ms -0.2%
Event Validation Full Scan Startup Large Batch 584.84ms 589.40ms +0.8%
Make Event Autodetection Small 30.92ms 31.02ms +0.3%
Make Event Autodetection Large 311.49ms 316.62ms +1.6%
Make Event Explicit Types 13.85ms 13.86ms +0.1%
Excavate Single Thread Small 4.045s 4.035s -0.2%
Excavate Single Thread Large 9.608s 9.705s +1.0%
Excavate Parallel Tasks Small 4.245s 4.284s +0.9%
Excavate Parallel Tasks Large 7.346s 7.428s +1.1%
Is Ip Performance 3.21ms 3.18ms -0.7%
Make Ip Type Performance 11.71ms 11.71ms -0.0%
Mixed Ip Operations 4.51ms 4.58ms +1.5%
Memory Use Web Crawl 40.8 MB 41.7 MB +2.2%
Memory Use Subdomain Enum 19.4 MB 19.4 MB -0.1%
Scan Throughput 100 7.229s 7.214s -0.2%
Scan Throughput 1000 36.565s 38.582s +5.5%
Typical Queue Shuffle 65.29µs 64.18µs -1.7%
Priority Queue Shuffle 724.36µs 730.35µs +0.8%

🎯 Performance Summary

No significant performance changes detected (all changes <10%)


🐍 Python Version 3.11.15

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91%. Comparing base (9de96b6) to head (f5e4ded).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #3069   +/-   ##
=====================================
- Coverage     91%     91%   -0%     
=====================================
  Files        437     437           
  Lines      37507   37509    +2     
=====================================
+ Hits       33922   33923    +1     
- Misses      3585    3586    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheTechromancer TheTechromancer merged commit 5be4993 into dev May 1, 2026
18 of 20 checks passed
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.

2 participants