Remove timing dependent packet checks from socket tests.
This avoids flaky tests and the check itself doesn't provide much value anyway. TBR=pthatcher@webrtc.org Review URL: https://codereview.webrtc.org/2005993002 . Cr-Commit-Position: refs/heads/master@{#12855}
This commit is contained in:
parent
8fcf414846
commit
5b53b0eeb4
@ -105,21 +105,12 @@ bool TestClient::CheckTimestamp(int64_t packet_timestamp) {
|
||||
if (packet_timestamp == -1) {
|
||||
res = false;
|
||||
}
|
||||
int64_t time_us = rtc::TimeMicros();
|
||||
if (prev_packet_timestamp_ != -1) {
|
||||
if (packet_timestamp < prev_packet_timestamp_) {
|
||||
res = false;
|
||||
}
|
||||
const int64_t kErrorMarginUs = 20000;
|
||||
if (packet_timestamp - prev_packet_timestamp_ <
|
||||
time_us - prev_time_us_ - kErrorMarginUs ||
|
||||
packet_timestamp - prev_packet_timestamp_ >
|
||||
time_us - prev_time_us_ + kErrorMarginUs) {
|
||||
res = false;
|
||||
}
|
||||
}
|
||||
prev_packet_timestamp_ = packet_timestamp;
|
||||
prev_time_us_ = time_us;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,6 @@ class TestClient : public sigslot::has_slots<> {
|
||||
std::vector<Packet*>* packets_;
|
||||
bool ready_to_send_;
|
||||
int64_t prev_packet_timestamp_;
|
||||
int64_t prev_time_us_;
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(TestClient);
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user