Skip to content

Fix a couple of test hangs when running sandboxed#808

Open
jcristau wants to merge 2 commits into
mozilla-releng:mainfrom
jcristau:test-hangs
Open

Fix a couple of test hangs when running sandboxed#808
jcristau wants to merge 2 commits into
mozilla-releng:mainfrom
jcristau:test-hangs

Conversation

@jcristau

@jcristau jcristau commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Add some mocks to avoid hitting the network, and fix the TaskProcess tests to avoid killing pid 1.

jcristau added 2 commits July 8, 2026 16:22
Add a mock to avoid populate_projects hitting github when running tests,
which adds flakyness, and breaks when running in a sandbox.
MagicMock().pid isn't a real int, so -process.pid resolved to 1 via
MagicMock's default __index__(), causing these tests to issue real
os.kill(1, SIGTERM/SIGKILL) calls instead of exercising the mocked
process.

Also drops a dead process.terminate.side_effect setup in
test_stop_handle_process_lookup_error. stop() used to call
self.process.terminate() in addition to os.kill(), but that call was
removed in 046ca77 (2019-01-31)
without updating this test, so that side_effect has had no effect
(and the os.kill(1, ...) bug has been latent) ever since.
@jcristau jcristau requested a review from a team as a code owner July 8, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant