diff options
author | Mark Spruiell <mes@zeroc.com> | 2006-02-01 21:31:28 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2006-02-01 21:31:28 +0000 |
commit | 388d0b7910a9560ebdbf2b4f2f911bd445d2c3a2 (patch) | |
tree | 02d31a1718d9773c1745bacc2d4fbe54167963db /php/config/TestUtil.py | |
parent | Fix last fix (diff) | |
download | ice-388d0b7910a9560ebdbf2b4f2f911bd445d2c3a2.tar.bz2 ice-388d0b7910a9560ebdbf2b4f2f911bd445d2c3a2.tar.xz ice-388d0b7910a9560ebdbf2b4f2f911bd445d2c3a2.zip |
fix for CentOS waitpid bug
Diffstat (limited to 'php/config/TestUtil.py')
-rw-r--r-- | php/config/TestUtil.py | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/php/config/TestUtil.py b/php/config/TestUtil.py index 24220f44de9..3118126c081 100644 --- a/php/config/TestUtil.py +++ b/php/config/TestUtil.py @@ -38,7 +38,7 @@ host = "localhost" # Don't change anything below this line! # -import sys, os, re +import sys, os, re, errno # # Check for ICE_HOME @@ -130,23 +130,34 @@ def getAdapterReady(serverPipe): def waitServiceReady(pipe, token): while 1: - output = pipe.readline().strip() - if not output: print "failed!" sys.exit(1) - if output == token + " ready": break def printOutputFromPipe(pipe): + while 1: line = pipe.readline() if not line: break os.write(1, line) +def closePipe(pipe): + + try: + status = pipe.close() + except IOError, ex: + # TODO: There's a waitpid problem on CentOS, so we have to ignore ECHILD. + if ex.errno == errno.ECHILD: + status = 0 + else: + raise + + return status + for toplevel in [".", "..", "../..", "../../..", "../../../.."]: toplevel = os.path.normpath(toplevel) if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): @@ -219,8 +230,8 @@ def clientServerTestWithOptionsAndNames(name, additionalServerOptions, additiona printOutputFromPipe(clientPipe) - clientStatus = clientPipe.close() - serverStatus = serverPipe.close() + clientStatus = closePipe(clientPipe) + serverStatus = closePipe(serverPipe) if clientStatus or serverStatus: killServers() |