From 3bfc60d466c94666c50f9f9b31fb52e6b8a08925 Mon Sep 17 00:00:00 2001 From: Tim Huang Date: Tue, 26 May 2020 19:23:29 +0000 Subject: [PATCH] Bug 1640259 - Add EPERM(Operation not permitted) as an expected error in isPidAlive() check. r=ahal We could hit this error if we open and close too many processes during the test. This could happen when Fission is enabled. The pid number could roll back to 1 if the pid is counted over than 32767 in linux. If this happened, we might check the pid which is opened by others. For example, we open and close the pid 1000 and after that the pid rolls back to 1 and the pid 1000 has been used by other process for any reasons. If this happens, we would hit this error during killing zombie processes in the end of the test. To resolve this, we can add EPERM as an expected error since this indicates that this pid has been used by other process, so the pid of the original process is no longer alive. Differential Revision: https://phabricator.services.mozilla.com/D76692 --- testing/mochitest/runtests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index b8564781f20e..930c016af6a5 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -438,7 +438,7 @@ else: except OSError as err: # Catch the errors we might expect from os.kill/os.waitpid, # and re-raise any others - if err.errno == errno.ESRCH or err.errno == errno.ECHILD: + if err.errno in (errno.ESRCH, errno.ECHILD, errno.EPERM): return False raise # TODO: ^ upstream isPidAlive to mozprocess