Skip to content

Disable multiple process pytest#1072

Merged
edwinyyyu merged 1 commit into
MemMachine:mainfrom
edwinyyyu:pytest_race
Feb 9, 2026
Merged

Disable multiple process pytest#1072
edwinyyyu merged 1 commit into
MemMachine:mainfrom
edwinyyyu:pytest_race

Conversation

@edwinyyyu

@edwinyyyu edwinyyyu commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Purpose of the change

Fix race conditions for test setup.
https://github.com/MemMachine/MemMachine/actions/runs/21809416843/job/62918512906
https://github.com/MemMachine/MemMachine/actions/runs/21770765203/job/62817615278

Description

Some tests require NLTK download.
NLTK download uses the following loop, which allows processes to see "bad" zip files before they are fully downloaded.

            infile = urlopen(info.url)
            with open(filepath, "wb") as outfile:
                num_blocks = max(1, info.size / (1024 * 16))
                for block in itertools.count():
                    s = infile.read(1024 * 16)  # 16k blocks.
                    outfile.write(s)
                    if not s:
                        break
                    if block % 2 == 0:  # how often?
                        yield ProgressMessage(min(80, 5 + 75 * (block / num_blocks)))
            infile.close()

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g., code style improvements, linting)
  • Documentation update
  • Project Maintenance (updates to build scripts, CI, etc., that do not affect the main project)
  • Security (improves security without changing functionality)

How Has This Been Tested?

Existing tests should pass more often.

  • Unit Test
  • Integration Test
  • End-to-end Test
  • Test Script (please provide)
  • Manual verification (list step-by-step instructions)

Checklist

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
@edwinyyyu edwinyyyu merged commit aaea7b7 into MemMachine:main Feb 9, 2026
66 of 79 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.

3 participants