Bug 1640259 - Add EPERM(Operation not permitted) as an expected error in isPidAlive() check. r=ahal
authorTim Huang <tihuang@mozilla.com>
Tue, 26 May 2020 19:23:29 +0000
changeset 532243 5c89d6071cbbc4bbefa21123e4ff3c6d2d137fe6
parent 532242 c91675d0cbadbe4ba5e5e961cccc1ee73355bd9a
child 532244 53cc0d95ca87299bdfb71351de4a4a006c9ea4a4
push id37452
push userbtara@mozilla.com
push dateWed, 27 May 2020 03:52:55 +0000
treeherdermozilla-central@a5792dafa479 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1640259, 32767
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -433,17 +433,17 @@ else:
 
             # Wait on it to see if it's a zombie. This can throw OSError.ECHILD if
             # the process terminates before we get to this point.
             wpid, wstatus = os.waitpid(pid, os.WNOHANG)
             return wpid == 0
         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
 
 #######################
 # HTTP SERVER SUPPORT #
 #######################