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

Issue 2927413002: Update VirtualSocketServerTest to use a fake clock. (Closed)

Created:
3 years, 6 months ago by Taylor Brandstetter
Modified:
3 years, 6 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, kwiberg-webrtc
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Update VirtualSocketServerTest to use a fake clock. Since this is a test for a fake network, it's only natural that it uses a fake clock as well. This makes the tests much faster, less flaky, and lets them be moved out of "webrtc_nonparallel_tests", since they no longer have a dependency on any "real" thing (sockets, or time) and can be run in parallel as easily as any other tests. As part of this CL, added the fake clock as an argument to VirtualSocketServer's and TestClient's constructors, since these classes have methods that wait synchronously for something to occur, and if the test is using a fake clock, they need to advance it in order to make progress. Lastly, added a DCHECK in Thread::ProcessMessages. If called with a nonzero time while a fake clock is used, it will get stuck in an infinite loop; a DCHECK is easier to notice than an infinite loop. BUG=webrtc:7727, webrtc:2409 Review-Url: https://codereview.webrtc.org/2927413002 Cr-Commit-Position: refs/heads/master@{#18544} Committed: https://chromium.googlesource.com/external/webrtc/+/22e0814d51ba730cb8a8eb420b1041e8e6e6ffd8

Patch Set 1 #

Patch Set 2 : Allow ProcessMessages with cmsLoop of kForever. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -37 lines) Patch
M webrtc/base/BUILD.gn View 4 chunks +3 lines, -4 lines 0 comments Download
M webrtc/base/testclient.h View 3 chunks +7 lines, -0 lines 0 comments Download
M webrtc/base/testclient.cc View 5 chunks +21 lines, -3 lines 0 comments Download
M webrtc/base/thread.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M webrtc/base/timeutils.h View 1 chunk +3 lines, -0 lines 0 comments Download
M webrtc/base/timeutils.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M webrtc/base/virtualsocket_unittest.cc View 12 chunks +32 lines, -25 lines 0 comments Download
M webrtc/base/virtualsocketserver.h View 3 chunks +9 lines, -0 lines 0 comments Download
M webrtc/base/virtualsocketserver.cc View 3 chunks +17 lines, -5 lines 0 comments Download

Messages

Total messages: 25 (18 generated)
Taylor Brandstetter
pthatcher: PTAL, or suggest another reviewer. kjellander: CC'ed you since this is related to https://codereview.webrtc.org/2909073002/
3 years, 6 months ago (2017-06-09 23:16:26 UTC) #3
pthatcher
lgtm
3 years, 6 months ago (2017-06-10 03:06:29 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2927413002/20001
3 years, 6 months ago (2017-06-12 20:33:25 UTC) #17
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started once the ...
3 years, 6 months ago (2017-06-12 20:33:27 UTC) #19
pthatcher1
lgtm
3 years, 6 months ago (2017-06-12 20:45:50 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2927413002/20001
3 years, 6 months ago (2017-06-12 21:28:26 UTC) #22
commit-bot: I haz the power
3 years, 6 months ago (2017-06-12 21:30:34 UTC) #25
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/external/webrtc/+/22e0814d51ba730cb8a8eb420...

Powered by Google App Engine
This is Rietveld 408576698