|
|
@ -1333,8 +1333,11 @@ TEST_P(ProxyEnd2endTest, EchoDeadline) { |
|
|
|
EXPECT_TRUE(s.ok()); |
|
|
|
EXPECT_TRUE(s.ok()); |
|
|
|
gpr_timespec sent_deadline; |
|
|
|
gpr_timespec sent_deadline; |
|
|
|
Timepoint2Timespec(deadline, &sent_deadline); |
|
|
|
Timepoint2Timespec(deadline, &sent_deadline); |
|
|
|
// Allow 1 second error.
|
|
|
|
// We want to allow some reasonable error given:
|
|
|
|
EXPECT_LE(response.param().request_deadline() - sent_deadline.tv_sec, 1); |
|
|
|
// - request_deadline() only has 1sec resolution so the best we can do is +-1
|
|
|
|
|
|
|
|
// - if sent_deadline.tv_nsec is very close to the next second's boundary we
|
|
|
|
|
|
|
|
// can end up being off by 2 in one direction.
|
|
|
|
|
|
|
|
EXPECT_LE(response.param().request_deadline() - sent_deadline.tv_sec, 2); |
|
|
|
EXPECT_GE(response.param().request_deadline() - sent_deadline.tv_sec, -1); |
|
|
|
EXPECT_GE(response.param().request_deadline() - sent_deadline.tv_sec, -1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|