DescriptionReland of: Improving the fake clock and using it to fix a flaky STUN timeout test.
When the fake clock's time is advanced, it now ensures all pending
queued messages have been dispatched. This allows us to write a
"SIMULATED_WAIT" macro that ticks the simulated clock by milliseconds up
until the target time.
Useful in this case, where we know the STUN timeout should take a total
of 9500ms, but it would be overly complex to write test code that waits
for each individual timeout, ensures a STUN packet has been
retransmited, etc.
(The test described above *should* be written, but it belongs in
p2ptransportchannel_unittest.cc, not webrtcsession_unittest.cc).
Committed: https://crrev.com/f5f03e823c2d522e84fce46bc8a7d57f913032ba
Cr-Commit-Position: refs/heads/master@{#13052}
Patch Set 1 #
Total comments: 1
Patch Set 2 : Revising comments etc. #
Total comments: 10
Patch Set 3 : Addressing comments. #
Total comments: 6
Patch Set 4 : Renaming SetClock to SetClockForTesting. #Patch Set 5 : Merge with master #Patch Set 6 : Fixing compile warning (wanted 'override' on destructor) #Patch Set 7 : Fix TSAN warning. #Patch Set 8 : Fixing memory leak in unrelated test, which left an orphaned thread. #Patch Set 9 : Fixing another TSan warning. #Patch Set 10 : Fixing double linkage of testclock.cc. #Patch Set 11 : Fixing another TSan warning. WebRtcSession wasn't completely shut down. #
Total comments: 2
Messages
Total messages: 32 (15 generated)
|