Skip to content

tests: give the resume shard fake a poll() method - #7309

Closed
bobcatchris wants to merge 1 commit into
ItsNotRexed:mainfrom
bobcatchris:fix/resume-shard-poll
Closed

bobcatchris wants to merge 1 commit into
ItsNotRexed:mainfrom
bobcatchris:fix/resume-shard-poll

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

Unclaimed test regression on current main 8575d36ed (checked board #7231 and open PRs; #7019/#7162 cover other make_game tests, not this mock).

make_game.translate() now reaps shard processes with p.poll(), but ResumeShardsTest's FakeProc only implemented wait(). All 11 tests in tests/test_make_game_resume.py error with AttributeError: 'FakeProc' object has no attribute 'poll' on main. This gives the fake real poll()/wait() semantics over one finish helper that writes its shard markers and returns the exit code.

Tested on Apple M2 / Python 3.13.18: python -I tests/test_make_game_resume.py → main 11 errors, this head OK. Test-only; no game data.

AI-assisted.

make_game.translate() now reaps shards with p.poll() instead of p.wait(), but
ResumeShardsTest's FakeProc only had wait(), so all 11 tests errored on
current main. Implement poll()/wait() over one finish helper that writes the
shard markers and returns the exit code. A/B on Apple M2: main 11 errors,
this head OK. No game data.

AI-assisted.

@devnull34 devnull34 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verified on Windows 11:

  • python -m unittest tests/test_make_game_resume.py passed all 14 tests (0.603s).
  • Validated FakeProc implementing poll() and wait() over unified _finish() helper, fixing shard reaping mock compatibility with make_game.translate().
  • Whitespace clean (git diff HEAD~1..HEAD --check).

@slint6614-dev

Copy link
Copy Markdown
Contributor

Works: merged into main 042c5f378, tests/test_make_game_resume.py goes from 11 errors to OK. Heads-up though: #7018 (opened earlier) fixes the same FakeProc.poll gap in 5 lines and also passes 11/11 on the same main, so only one of the two is needed. AI-assisted (Claude).

@best2135

Copy link
Copy Markdown

Tested 8f4edc6 on Linux (kernel 7.2), Python 3.14.8, CPU only: pass

On main (26ecd9f) test_make_game_resume fail; at this head and with this head merged onto 26ecd9f they pass.

python -I tests/test_make_game_resume.py

AI-assisted check (Claude Code); counts and pass/fail only, no game data.

@bobcatchris

Copy link
Copy Markdown
Contributor Author

Closing this: #7018 was opened earlier for the same tests/test_make_game_resume.py fake, merges cleanly with current main (merge-tree rc 0), and has four independent passing checks. One fix for the missing poll() is enough; this branch's larger fake is not needed.

AI-assisted.

@aarushkha

Copy link
Copy Markdown

Tested 8f4edc6 merged onto main 86a7807dd on Windows 10 Pro 22H2 (19045), Python 3.14.3: pass.

  • python -I tests/test_make_game_resume.py: Ran 14 tests in 2.123s OK (red on main)

#7018 also passes here.

It merges cleanly together with #7092 #6049 #7120 #6513 #7242 #7209 #6254 #7214 #6957 #4771 #7029 #7094 #7129 #6508 #7152 #7174 #7032 onto main; with all of them applied, the only standalone test still red on Windows is test_first_look_paths (claimed by Racurs156). Summary in #7333.

No GPU or game files needed. AI-assisted (Claude Code); I read the diff before running it.

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.

5 participants