Commit 169fcec
committed
fix(tests): power-cycle helper must run on Python 3.6, which CI uses
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.1 parent a5df311 commit 169fcec
1 file changed
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
117 | | - | |
| 125 | + | |
| 126 | + | |
118 | 127 | | |
119 | 128 | | |
120 | | - | |
| 129 | + | |
| 130 | + | |
121 | 131 | | |
122 | 132 | | |
123 | 133 | | |
| |||
0 commit comments