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

Issue 10388206: [sync] Add --port and --xmpp-port parameters to run_testserver.cc (Closed)

Created:
8 years, 7 months ago by Raghu Simha
Modified:
8 years, 7 months ago
CC:
chromium-reviews, pam+watch_chromium.org, cbentzel+watch_chromium.org, darin-cc_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

[sync] Add --port and --xmpp-port parameters to run_testserver.cc run_testserver is a useful test utility that launches a python testserver after setting the required python path. When it is used to start a sync testserver, the only parameter it supports is --sync, indicating that we want a sync server. It doesn't support the --port and --xmpp-port flags, that are used to specify the ports on which we want the sync server and sync xmpp server to run. This patch adds the parameters to run_testserver.cc and plumbs them down to the TestServer objects created by run_testserver.cc. It also separates out sync specific testserver code into a new class called LocalSyncTestServer. Separating the sync server in python code is out of the scope of this CL because it requires significant refactoring, since it is in use on multiple platforms, and will be dealt with separately. BUG=117559 TEST=Build and run run_testserver with the paramters --sync, --port and --xmpp-port Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=138878

Patch Set 1 : "" #

Total comments: 2

Patch Set 2 : Separate out sync specific stuff #

Patch Set 3 : Fix compile with OVERRIDE #

Total comments: 10

Patch Set 4 : Fix nits #

Total comments: 22

Patch Set 5 : More CR feedback #

Patch Set 6 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -22 lines) Patch
M chrome/browser/sync/test/integration/sync_test.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.cc View 1 2 3 4 5 1 chunk +1 line, -4 lines 0 comments Download
M net/net.gyp View 1 1 chunk +2 lines, -0 lines 0 comments Download
M net/test/OWNERS View 1 1 chunk +4 lines, -0 lines 0 comments Download
A net/test/local_sync_test_server.h View 1 2 3 4 1 chunk +43 lines, -0 lines 0 comments Download
A net/test/local_sync_test_server.cc View 1 2 3 4 1 chunk +40 lines, -0 lines 0 comments Download
M net/test/local_test_server.h View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M net/tools/testserver/run_testserver.cc View 1 2 3 4 4 chunks +51 lines, -9 lines 0 comments Download
M net/tools/testserver/testserver.py View 1 2 3 4 5 4 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Raghu Simha
Guys, please review. Thanks. akalin: changes to net/tools/testserver phajdan.jr: changes to net/test
8 years, 7 months ago (2012-05-18 23:38:03 UTC) #1
akalin
On 2012/05/18 23:38:03, rsimha wrote: > Guys, please review. Thanks. > > akalin: changes to ...
8 years, 7 months ago (2012-05-19 00:24:19 UTC) #2
Raghu Simha
On 2012/05/19 00:24:19, akalin wrote: > Hmm what's the use case for this? I thought ...
8 years, 7 months ago (2012-05-19 01:54:19 UTC) #3
Paweł Hajdan Jr.
http://codereview.chromium.org/10388206/diff/8001/net/test/base_test_server.h File net/test/base_test_server.h (right): http://codereview.chromium.org/10388206/diff/8001/net/test/base_test_server.h#newcode174 net/test/base_test_server.h:174: void SetXmppPort(uint16 xmpp_port); Please stop this. I asked you ...
8 years, 7 months ago (2012-05-21 08:36:46 UTC) #4
Raghu Simha
Folks, PTAL. mmenke: net.gyp only. phajdan.jr: base_test_server.h only. akalin: everything else. http://codereview.chromium.org/10388206/diff/8001/net/test/base_test_server.h File net/test/base_test_server.h (right): ...
8 years, 7 months ago (2012-05-23 02:25:10 UTC) #5
mmenke
On 2012/05/23 02:25:10, rsimha wrote: > Folks, PTAL. > > mmenke: net.gyp only. > phajdan.jr: ...
8 years, 7 months ago (2012-05-23 03:01:31 UTC) #6
akalin
> Why is sync-specific testing code living in net/? Just convenience, or are > there ...
8 years, 7 months ago (2012-05-23 03:12:08 UTC) #7
mmenke
On 2012/05/23 03:12:08, akalin wrote: > > Why is sync-specific testing code living in net/? ...
8 years, 7 months ago (2012-05-23 03:21:16 UTC) #8
Raghu Simha
On 2012/05/23 03:01:31, Matt Menke wrote: > Why is sync-specific testing code living in net/? ...
8 years, 7 months ago (2012-05-23 05:09:59 UTC) #9
akalin
LGTM after nits. http://codereview.chromium.org/10388206/diff/8032/net/test/local_sync_test_server.h File net/test/local_sync_test_server.h (right): http://codereview.chromium.org/10388206/diff/8032/net/test/local_sync_test_server.h#newcode32 net/test/local_sync_test_server.h:32: virtual void CleanUpWhenStoppingServer() OVERRIDE; #include base/compiler_specific.h ...
8 years, 7 months ago (2012-05-23 05:29:21 UTC) #10
Raghu Simha
akalin: Nits fixed. Thanks for the review. phajdan.jr: PTAL. http://codereview.chromium.org/10388206/diff/8032/net/test/local_sync_test_server.h File net/test/local_sync_test_server.h (right): http://codereview.chromium.org/10388206/diff/8032/net/test/local_sync_test_server.h#newcode32 net/test/local_sync_test_server.h:32: ...
8 years, 7 months ago (2012-05-23 06:02:58 UTC) #11
akalin
feel free to take care of these in a future CL http://codereview.chromium.org/10388206/diff/2007/net/test/local_sync_test_server.cc File net/test/local_sync_test_server.cc (right): ...
8 years, 7 months ago (2012-05-23 06:16:49 UTC) #12
Paweł Hajdan Jr.
+jnd, is this going to possibly break Android's RemoteTestServer? This is better. http://codereview.chromium.org/10388206/diff/2007/net/test/OWNERS File net/test/OWNERS ...
8 years, 7 months ago (2012-05-23 06:53:02 UTC) #13
Raghu Simha
jnd: This doesn't change BaseTestServer or RemoteTestServer in any way, so I believe the android ...
8 years, 7 months ago (2012-05-23 19:54:27 UTC) #14
Johnny(Jianning) Ding
@rsimha, yes, you change should not break android net server based tests. I just have ...
8 years, 7 months ago (2012-05-24 03:22:49 UTC) #15
Raghu Simha
8 years, 7 months ago (2012-05-24 03:32:19 UTC) #16
On 2012/05/24 03:22:49, Johnny(Jianning) Ding wrote:
> @rsimha, yes, you change should not break android net server based tests.
> 
> I just have a question, why you need to launch sync server in a specific port
> instead of letting Python socket pick up an available/ephemeral port and send
> back to you?
> Android net server based tests used to use some specific fixed ports to launch
> Python test server. But Ryan told me that Chromium always uses the random
> ephemeral port given by OS(via Python) to run the test server based tests in
> order to make the test more robust, that is because sometimes you may
encounter
> weird issue when shutting down the server on the port. In that case,
restarting
> server on same port later may fail. So now the Android tests don't specify the
> port when launching Python test server.

What you say above is true. I do not plan on discontinuing the use of ephemeral
ports for chrome's sync integration tests. This CL is meant purely to ease the
manual running of run_testserver.exe, and is part of a larger effort that
utilizes the python sync server.

Powered by Google App Engine
This is Rietveld 408576698