summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-28 07:14:19 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-28 07:14:19 +0000
commit480d8870bb4a007c2816a643106fecec96abe394 (patch)
tree32c2810fa54a767911c602316368138b33cd476a
parent84868e93da318ebae5d5264a91d84e12efd036d1 (diff)
downloadchromium_src-480d8870bb4a007c2816a643106fecec96abe394.zip
chromium_src-480d8870bb4a007c2816a643106fecec96abe394.tar.gz
chromium_src-480d8870bb4a007c2816a643106fecec96abe394.tar.bz2
Hack around testserver issues with stdout and stderr on Win XP bots.
Re-enable python unbuffered output on win. Re-enable SafeBrowsingServerTest. BUG=96459,147368 Review URL: https://chromiumcodereview.appspot.com/11316039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169876 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_test.cc3
-rw-r--r--net/test/python_utils.cc2
-rw-r--r--net/tools/testserver/testserver_base.py17
3 files changed, 16 insertions, 6 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc
index 692aa0c..cad8262 100644
--- a/chrome/browser/safe_browsing/safe_browsing_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_test.cc
@@ -438,9 +438,8 @@ class SafeBrowsingServerTestHelper
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServerTestHelper);
};
-// See http://crbug.com/96459
IN_PROC_BROWSER_TEST_F(SafeBrowsingServerTest,
- DISABLED_SafeBrowsingServerTest) {
+ SafeBrowsingServerTest) {
LOG(INFO) << "Start test";
ASSERT_TRUE(InitSafeBrowsingService());
diff --git a/net/test/python_utils.cc b/net/test/python_utils.cc
index d819414..be9facf 100644
--- a/net/test/python_utils.cc
+++ b/net/test/python_utils.cc
@@ -119,11 +119,9 @@ bool GetPythonCommand(CommandLine* python_cmd) {
python_cmd->SetProgram(dir);
-#if defined(OS_POSIX)
// Launch python in unbuffered mode, so that python output doesn't mix with
// gtest output in buildbot log files. See http://crbug.com/147368.
python_cmd->AppendArg("-u");
-#endif
return true;
}
diff --git a/net/tools/testserver/testserver_base.py b/net/tools/testserver/testserver_base.py
index 076943e..835ec35 100644
--- a/net/tools/testserver/testserver_base.py
+++ b/net/tools/testserver/testserver_base.py
@@ -44,6 +44,19 @@ class FileMultiplexer(object):
self.__fd2.flush()
+def MultiplexerHack(std_fd, log_fd):
+ """Creates a FileMultiplexer that will write to both specified files.
+
+ When running on Windows XP bots, stdout and stderr will be invalid file
+ handles, so log_fd will be returned directly. (This does not occur if you
+ run the test suite directly from a console, but only if the output of the
+ test executable is redirected.)
+ """
+ if std_fd.fileno() <= 0:
+ return log_fd
+ return FileMultiplexer(std_fd, log_fd)
+
+
class TestServerRunner(object):
"""Runs a test server and communicates with the controlling C++ test code.
@@ -59,9 +72,9 @@ class TestServerRunner(object):
self.options, self.args = self.option_parser.parse_args()
logfile = open('testserver.log', 'w')
- sys.stderr = FileMultiplexer(sys.stderr, logfile)
+ sys.stderr = MultiplexerHack(sys.stderr, logfile)
if self.options.log_to_console:
- sys.stdout = FileMultiplexer(sys.stdout, logfile)
+ sys.stdout = MultiplexerHack(sys.stdout, logfile)
else:
sys.stdout = logfile