fix(tests): power-cycle helper must run on Python 3.6, which CI uses - #38
Merged
Conversation
The two power-cycle lifetime tests kept FAILING in CI after being taught to
skip, and the skip was never the problem:
_emulator_process() -> subprocess.run(..., capture_output=True, text=True)
TypeError: __init__() got an unexpected keyword argument 'capture_output'
`capture_output=` and `text=` are Python 3.7+. The CI python-keepkey container
runs 3.6, so the helper raised inside subprocess before any of its own logic --
including the skip added last commit -- could run. Locally it passed because
this machine runs 3.10.
Replaced all three uses with stdout=/stderr=PIPE plus universal_newlines, which
3.6 and 3.10 both understand, and recorded why in the docstring so nobody
"modernises" it back.
Also: a missing lsof now returns None instead of raising. That is the same
situation as a remote emulator -- the harness cannot identify the process, let
alone restart it -- so it belongs on the skip path, not the failure path. A
green tree should not go red because a container lacks a tool.
Worth stating for the next person: this failure was invisible locally in every
run, and the previous fix looked correct precisely because it was tested on the
wrong interpreter. The environment is part of the test.
Local run (Python 3.10, harness owns the emulator): 6/6, both power-cycle tests
executing rather than skipping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The two power-cycle lifetime tests kept failing in CI after being taught to skip — and the skip was never the problem:
capture_output=andtext=are Python 3.7+. The CI python-keepkey container runs 3.6, so the helper raised insidesubprocessbefore any of its own logic — including the skip added last commit — could run. Locally it passed because this machine runs 3.10.Replaced all three uses with
stdout=/stderr=PIPEplusuniversal_newlines, which 3.6 and 3.10 both understand, and recorded why in the docstring so nobody "modernises" it back.Also: a missing
lsofnow returnsNoneinstead of raising. Same situation as a remote emulator — the harness cannot identify the process, let alone restart it — so it belongs on the skip path, not the failure path. A green tree should not go red because a container lacks a tool.Worth stating for the next person: this failure was invisible locally in every run, and the previous fix looked correct precisely because it was tested on the wrong interpreter. The environment is part of the test.
Local (3.10, harness owns the emulator): 6/6, both power-cycle tests executing rather than skipping.