mirror of
https://github.com/servo/servo
synced 2026-05-09 00:22:16 +02:00
#38614 was reverted due to CI flakiness, but it also included several improvements to the devtools tests. this patch relands those improvements, described below. we make three changes that speed up the devtools tests from 73 → 65 → 56 → 51 seconds: - we replace the hardcoded sleep(1) after starting servoshell with a loop that waits until the devtools port is open (this also fixes intermittent failures when servoshell starts too slowly, especially on macOS) - we start the internal web servers once, and reuse them across all tests - we run servoshell in headless mode (this is also required because most CI runners have no GUI) and we fix two bugs that cause very noisy but not very interesting error messages: - in the test code, we use a [context manager](https://docs.python.org/3/reference/datamodel.html#context-managers) to ensure the devtools client is disconnected unconditionally, even if test methods or assert helper methods raise exceptions (this was causing errors on all platforms) - in the devtools server, we treat “connection reset” errors when reading from the client like a normal EOF, rather than as a failure (this was causing errors on Windows) on self-hosted linux builds, there are still spurious error messages like the following, but we can fix them later: ``` error: XDG_RUNTIME_DIR not set in the environment. libEGL warning: egl: failed to create dri2 screen ``` Testing: this patch improves the devtools tests, but does not change their coverage Fixes: part of #36325 --------- Signed-off-by: Delan Azabani <dazabani@igalia.com> Signed-off-by: atbrakhi <atbrakhi@igalia.com> Co-authored-by: atbrakhi <atbrakhi@igalia.com>