Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Issue 10907162: Reland: Take 2: Force python test server output to be unbuffered, so it doesn't mix with gtest outpu (Closed)

Created:
8 years, 3 months ago by Raghu Simha
Modified:
8 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, cbentzel+watch_chromium.org, jam, pam+watch_chromium.org
Visibility:
Public.

Description

Reland: Take 2: Force python test server output to be unbuffered, so it doesn't mix with gtest output In browser tests that use a local python server, the python output in the test logs sometimes overlaps with gtest output, resulting in gtest falsely detecting passing tests as incomplete. This is a result of python's default use of buffered output, which gets written to the log file out of order. This patch forces the python process for local test servers to use unbuffered mode via the -u switch. This way, by the time gtest is ready to log a passing test, all testserver output is already written to the log file. Update: The win xp bots were adversely affected by the -u switch, so we now apply it only for mac and linux, which is where the original problem was found. BUG=147368 TEST=See sync integration test output when it is redirected to a log file, and make sure there are no false negatives. Originally committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=156361 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=156389

Patch Set 1 #

Total comments: 2

Patch Set 2 : Make GetPythonRunTime take a CommandLine instead of a FilePath. #

Total comments: 4

Patch Set 3 : Fix nits #

Patch Set 4 : Don't use unbuffered mode on Windows. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -36 lines) Patch
M chrome/browser/safe_browsing/safe_browsing_test.cc View 1 2 1 chunk +3 lines, -6 lines 0 comments Download
M content/public/test/browser_test_utils.cc View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M content/test/layout_test_http_server.cc View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M net/test/local_test_server_posix.cc View 1 2 1 chunk +5 lines, -3 lines 0 comments Download
M net/test/local_test_server_win.cc View 1 2 2 chunks +3 lines, -7 lines 0 comments Download
M net/test/python_utils.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M net/test/python_utils.cc View 1 2 3 2 chunks +18 lines, -6 lines 0 comments Download
M net/test/python_utils_unittest.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M net/tools/testserver/run_testserver.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Raghu Simha
Pawel, please review. Note: I had to revert the previous attempt at this fix (involving ...
8 years, 3 months ago (2012-09-10 23:43:33 UTC) #1
Paweł Hajdan Jr.
http://codereview.chromium.org/10907162/diff/1/content/public/test/browser_test_utils.cc File content/public/test/browser_test_utils.cc (right): http://codereview.chromium.org/10907162/diff/1/content/public/test/browser_test_utils.cc#newcode550 content/public/test/browser_test_utils.cc:550: cmd_line->AppendArg("-u"); Why not in CreatePythonCommandLine? In fact, to reduce ...
8 years, 3 months ago (2012-09-11 08:57:30 UTC) #2
Raghu Simha
Pawel, PTAL. http://codereview.chromium.org/10907162/diff/1/content/public/test/browser_test_utils.cc File content/public/test/browser_test_utils.cc (right): http://codereview.chromium.org/10907162/diff/1/content/public/test/browser_test_utils.cc#newcode550 content/public/test/browser_test_utils.cc:550: cmd_line->AppendArg("-u"); On 2012/09/11 08:57:31, Paweł Hajdan Jr. ...
8 years, 3 months ago (2012-09-11 21:58:04 UTC) #3
Raghu Simha
Looks like we have more widespread problems than just testserver output. For example, see the ...
8 years, 3 months ago (2012-09-12 00:10:05 UTC) #4
Raghu Simha
What I mean is to use this as the first line in all gtest and ...
8 years, 3 months ago (2012-09-12 00:11:53 UTC) #5
Paweł Hajdan Jr.
This LGTM with comments. I'm not sure if #!/usr/bin/python -u would help - we launch ...
8 years, 3 months ago (2012-09-12 10:37:25 UTC) #6
Raghu Simha
Nits fixed. Landing via CQ. http://codereview.chromium.org/10907162/diff/6003/content/public/test/browser_test_utils.cc File content/public/test/browser_test_utils.cc (right): http://codereview.chromium.org/10907162/diff/6003/content/public/test/browser_test_utils.cc#newcode518 content/public/test/browser_test_utils.cc:518: CHECK(GetPythonRunTime(cmd_line)); On 2012/09/12 10:37:25, ...
8 years, 3 months ago (2012-09-12 18:31:20 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsimha@chromium.org/10907162/9
8 years, 3 months ago (2012-09-12 18:50:34 UTC) #8
commit-bot: I haz the power
Presubmit check for 10907162-9 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 3 months ago (2012-09-12 18:50:38 UTC) #9
Raghu Simha
+shess for chrome/browser/safe_browsing/safe_browsing_test.cc owner approval.
8 years, 3 months ago (2012-09-12 18:52:44 UTC) #10
Scott Hess - ex-Googler
8 years, 3 months ago (2012-09-12 19:41:05 UTC) #11
lgtm for safe_browsing.

Powered by Google App Engine
This is Rietveld 408576698