Closed Bug 1855174 Opened 8 months ago Closed 7 months ago

Process node server output in realtime

Categories

(Testing :: XPCShell Harness, enhancement, P2)

enhancement

Tracking

(firefox120 fixed)

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: valentin, Assigned: valentin)

References

Details

Attachments

(1 file)

console.log messages from the node servers would benefit from being displayed in the logs at the time they are issues, not at the end of the test.
To achieve this, we need to be reading from the stdout,stderr streams on a separate thread and push it out into self.log.info

Spawned nodejs servers sometimes print output to stdout or stderr.
While it's not strictly necessary to display, it's sometimes useful for
debugging, but it's problematic that we only dump the output when killing
the node server.

After landing D189212 this becomes even more problematic, as killing the
process via os.killpg means the file descriptors are already closed.

This patch makes it so for each started server we also spawn a new thread
that reads from stdout and stderr. This way the output is present in the
logs at the correct time.

Depends on D189212

Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/45571d960e8a
Process xpcshell node output in realtime r=jmaher,necko-reviewers,kershaw

Backed out with Bug 1772329 for causing xpcshell failures.

[task 2023-09-28T08:08:47.458Z] cleanup
[task 2023-09-28T08:08:47.492Z] ++ cleanup
[task 2023-09-28T08:08:47.493Z] ++ local rv=0
[task 2023-09-28T08:08:47.496Z] ++ [[ -s /builds/worker/.xsession-errors ]]
[task 2023-09-28T08:08:47.497Z] ++ cp /builds/worker/.xsession-errors /builds/worker/artifacts/public/xsession-errors.log
[task 2023-09-28T08:08:47.501Z] /builds/worker/bin/test-linux.sh: line 97:   120 Terminated              ${mozharness_bin}
[task 2023-09-28T08:08:47.503Z] ++ '[' ']'
[task 2023-09-28T08:08:47.504Z] ++ true
[task 2023-09-28T08:08:47.504Z] ++ cleanup_xvfb
[task 2023-09-28T08:08:47.506Z] +++ pidof Xvfb
[task 2023-09-28T08:08:47.507Z] ++ local xvfb_pid=49
[task 2023-09-28T08:08:47.508Z] ++ local vnc=false
[task 2023-09-28T08:08:47.516Z] ++ local interactive=false
[task 2023-09-28T08:08:47.517Z] ++ '[' -n 49 ']'
[task 2023-09-28T08:08:47.518Z] ++ [[ false == false ]]
[task 2023-09-28T08:08:47.518Z] ++ [[ false == false ]]
[task 2023-09-28T08:08:47.519Z] ++ kill 49
[task 2023-09-28T08:08:47.520Z] ++ screen -XS xvfb quit
[task 2023-09-28T08:08:47.521Z] No screen session found.
[task 2023-09-28T08:08:47.522Z] ++ true
[task 2023-09-28T08:08:47.523Z] ++ exit 0
[taskcluster 2023-09-28 08:08:48.559Z] === Task Finished ===
[taskcluster 2023-09-28 08:08:49.206Z] Unsuccessful task run with exit code: 241 completed in 253.091 seconds

Flags: needinfo?(valentin.gosu)

There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:valentin, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(valentin.gosu)
Flags: needinfo?(jmaher)
Flags: needinfo?(jmaher)
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/ee5517b78726
Process xpcshell node output in realtime r=jmaher,necko-reviewers,kershaw
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Flags: needinfo?(moz.valentin)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: