Skip to content

Commit 3c85067

Browse files
Fix and re-enable the Linux tv commissioner-generated-passcode CI test
1 parent dddabd6 commit 3c85067

File tree

3 files changed

+21
-29
lines changed

3 files changed

+21
-29
lines changed

.github/workflows/examples-linux-tv-casting-app.yaml

+7-10
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,13 @@ jobs:
7272
"python3 ./scripts/tests/run_tv_casting_test.py"
7373
timeout-minutes: 2 # Comment this out to debug if GitHub Action times out.
7474

75-
# TODO: this test is flaky and was disabled
76-
# https://github.com/project-chip/connectedhomeip/issues/34598
77-
#
78-
# - name:
79-
# Test casting from Linux tv-casting-app to Linux tv-app -
80-
# Commissioner Generated Passcode
81-
# run: |
82-
# ./scripts/run_in_build_env.sh \
83-
# "python3 ./scripts/tests/run_tv_casting_test.py --commissioner-generated-passcode=True"
84-
# timeout-minutes: 2 # Comment this out to debug if GitHub Action times out.
75+
- name:
76+
Test casting from Linux tv-casting-app to Linux tv-app -
77+
Commissioner Generated Passcode
78+
run: |
79+
./scripts/run_in_build_env.sh \
80+
"python3 ./scripts/tests/run_tv_casting_test.py --commissioner-generated-passcode=True"
81+
timeout-minutes: 2 # Comment this out to debug if GitHub Action times out.
8582

8683
- name: Uploading Size Reports
8784
uses: ./.github/actions/upload-size-reports

scripts/tests/linux/log_line_processing.py

+14-17
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,20 @@ def _io_thread(self):
6868
f.flush()
6969
while not self.done:
7070
changes = out_wait.poll(0.1)
71-
if changes:
72-
out_line = self.process.stdout.readline()
73-
if not out_line:
74-
# stdout closed (otherwise readline should have at least \n)
75-
continue
76-
f.write(out_line)
77-
f.flush()
78-
self.output_lines.put(out_line)
79-
80-
changes = err_wait.poll(0)
81-
if changes:
82-
err_line = self.process.stderr.readline()
83-
if not err_line:
84-
# stderr closed (otherwise readline should have at least \n)
85-
continue
86-
f.write(f"!!STDERR!! : {err_line}")
87-
f.flush()
71+
for fd, _ in changes:
72+
if fd == self.process.stdout.fileno():
73+
while True:
74+
out_line = self.process.stdout.readline()
75+
if not out_line:
76+
break
77+
f.write(out_line)
78+
f.flush()
79+
self.output_lines.put(out_line)
80+
elif fd == self.process.stderr.fileno():
81+
err_line = self.process.stderr.readline()
82+
if err_line:
83+
f.write(f"!!STDERR!! : {err_line}")
84+
f.flush()
8885
f.write("PROCESS END: %s\n" % time.ctime())
8986
f.flush()
9087

scripts/tests/run_tv_casting_test.py

-2
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ def send_input_cmd_to_subprocess(
205205
f"{test_sequence_name} - Sent `{input_cmd}` to the {app_name} subprocess."
206206
)
207207

208-
time.sleep(0.5)
209-
210208

211209
def handle_input_cmd(
212210
processes: RunningProcesses, test_sequence_name: str, test_sequence_step: Step

0 commit comments

Comments
 (0)