Skip to content

Commit f843507

Browse files
Fix and re-enable Linux tv commissioner-generated-passcode CI test
1 parent dd5ea1b commit f843507

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

scripts/tests/linux/log_line_processing.py

+18-16
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,27 @@ def _io_thread(self):
6363
err_wait = select.poll()
6464
err_wait.register(self.process.stderr, select.POLLIN | select.POLLHUP)
6565

66-
with open(self.output_path, "wt") as f:
66+
with open(self.output_path, "wt", buffering=1) as f:
6767
f.write("PROCESS START: %s\n" % time.ctime())
68+
f.flush()
6869
while not self.done:
6970
changes = out_wait.poll(0.1)
70-
if changes:
71-
out_line = self.process.stdout.readline()
72-
if not out_line:
73-
# stdout closed (otherwise readline should have at least \n)
74-
continue
75-
f.write(out_line)
76-
self.output_lines.put(out_line)
77-
78-
changes = err_wait.poll(0)
79-
if changes:
80-
err_line = self.process.stderr.readline()
81-
if not err_line:
82-
# stderr closed (otherwise readline should have at least \n)
83-
continue
84-
f.write(f"!!STDERR!! : {err_line}")
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()
8585
f.write("PROCESS END: %s\n" % time.ctime())
86+
f.flush()
8687

8788
def __enter__(self):
8889
self.done = False
@@ -92,6 +93,7 @@ def __enter__(self):
9293
stdout=subprocess.PIPE,
9394
stderr=subprocess.PIPE,
9495
text=True,
96+
bufsize=1,
9597
)
9698
self.io_thread = threading.Thread(target=self._io_thread)
9799
self.io_thread.start()

src/lib/dnssd/MinimalMdnsServer.h

-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class GlobalMinimalMdnsServer : public mdns::Minimal::ServerDelegate
6565
{
6666
if (mQueryDelegate != nullptr)
6767
{
68-
ChipLogProgress(AppServer, "mQueryDelegate - Hacky fix");
6968
mQueryDelegate->OnMdnsPacketData(data, info);
7069
}
7170
}
@@ -74,7 +73,6 @@ class GlobalMinimalMdnsServer : public mdns::Minimal::ServerDelegate
7473
{
7574
if (mResponseDelegate != nullptr)
7675
{
77-
ChipLogProgress(AppServer, "mResponseDelegate - Hacky fix");
7876
mResponseDelegate->OnMdnsPacketData(data, info);
7977
}
8078
}

0 commit comments

Comments
 (0)