Skip to content

Add multithreaded tests - #62

Merged
DoctorJohn merged 3 commits into
DoctorJohn:mainfrom
ngoldbaum:multithreaded-tests
Mar 20, 2026
Merged

DoctorJohn merged 3 commits into
DoctorJohn:mainfrom
ngoldbaum:multithreaded-tests

Conversation

@ngoldbaum

Copy link
Copy Markdown
Contributor

This tests the current behavior under multithreaded execution.

Since ArchiveReader isn't Send, I think the test I added for the reader is the only reasonable thing to do, given upstream support for this kind of panic in PyO3.

It's possible to improve the multithreaded Python user experience a little bit for ArchiveWriter by using the frozen option to PyClass and using interior mutability (via std::sync::Mutex or some other mechanism) to handle concurrent access. See https://pyo3.rs/v0.28.2/class.html#frozen-classes-opting-out-of-interior-mutability for more about this.

@codspeed

codspeed Bot commented Mar 19, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing ngoldbaum:multithreaded-tests (ec3a630) with main (f0a02fc)

Open in CodSpeed

@DoctorJohn DoctorJohn left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Excellent, thank you @ngoldbaum. I appreciate both additions to the test suit.

Comment thread tests/test_archive_writer.py Resolved
@DoctorJohn
DoctorJohn merged commit af1804a into DoctorJohn:main Mar 20, 2026
31 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