Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python 3.12 to run_tests github workflow #1856

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

bosh
Copy link
Contributor

@bosh bosh commented Dec 6, 2024

Expecting to expose issues via github that need addressing for the upgrade -- not really ready to review

Expecting to expose issues that need addressing for the upgrade
@bosh
Copy link
Contributor Author

bosh commented Dec 6, 2024

Looks like there are issues in some platform-specific code, or their tests: Lisy, PKONE, and Spike

@avanwinkle
Copy link
Collaborator

I've seen these issues before, something to do with how MPF tests setup the serial devices and send/expect serial commands. I explored a little bit but didn't get too far, I was looking at PKONE and it seemed like the commands were being sent multiple times and the test only expected the responses once.

Thanks for taking a look, hopefully you have more success than I did!

@bosh
Copy link
Contributor Author

bosh commented Dec 6, 2024

Haha thanks - I'm glad to see it's not an excessive amount of errors. I'll give it a shot one of these days.

With Python 3.8 now in EOL, what's the MPF practice for deprecating 3.8 support?

@bosh
Copy link
Contributor Author

bosh commented Dec 13, 2024

After all this investigation, I'm starting to think the common thread between all of the errors is linked to behavior of queues and dequeuing operations, especially in test fakes. Windows and *nix systems seem to different in dequeue behavior but I can't put my finger on it.

First, something completely unrelated - 3.12 shows warnings on using ast.Number/etc instead of ast.Constant. There's a piece of supported-feature-check code that enables Constant, so maybe for other library compatibility we need to keep it as is. If not, just replacing all the deprecated ast types with Constant seems to work across all versions, could be worth pulling out to .57 -- https://github.com/missionpinball/mpf/pull/1856/files#diff-272a790e6b3c028190676eceb8a70434bdc1473434f47e4cc4826efdbbe70287 or maybe we don't change it at all!

@bosh
Copy link
Contributor Author

bosh commented Dec 13, 2024

There are some groups of failures, and I'm going to leave notes about each in hopes of pointing at some common source.

First, the Lisy test. I ran different combinations of command, and only the flash-related section of the test fails (after it are some sound tests, which work fine when run in another order). The specific error is that an expected command is never cleared from the expected set, suggesting it is never sent. Flash is time-based, so I ran slightly longer before checking, and Windows passed (but everything else started failing). Maybe the test time is exactly on the cutoff time and Windows has a different precision or tiebreak than nix, so it only needs a moment longer?

@bosh
Copy link
Contributor Author

bosh commented Dec 13, 2024

Next, PKONE: These tests all fail the same way in setup, on mac/unix with 3.12 only --
The first command (maybe all of them?) seems to be double sent, but the mock manager clears the command from the set on the first and bombs on the second. More specifically, the first command is PCNE (E is a separator), and the second is received as PCNEPRSE. Somehow the first command is not being cleared out, and I suspect it's related to the internal behaviors of BaseMockPKONE#queue

Finally, Spike: Interesting that the commonality with all three is that they're in platform integrations, and I think it's due to them all having mock serial implementations that they interact with in test. The Spike tests fail because they get a node value of 255 instead something within the range 0-15. Feels to me like a (leading? https://github.com/missionpinball/mpf/actions/runs/12295483583/job/34312458054#step:5:1256 ) FF value from a previous command is being read as the next command's node number. Again the serial mock seems to be reusing an old value, and uses a queue under the hood.

AHA Okay a clue -- they all use MockSerial under the hood. Maybe there's one common piece to all of it. More digging to come. Edit: nope lol, looks like MockSerial is just an interface with a bunch of stubs that will yell at you if you try to use them. So back to the queue usage in Lisy/PKONE/Spike code theory

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