MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/platform/cloud/gcs_throttle_test.cc:99–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99TEST(GcsThrottleDisabledTest, Disabled) {
100 TestTime time;
101 GcsThrottle throttle(&time);
102 ASSERT_FALSE(throttle.is_enabled()); // Verify throttle is disabled.
103
104 EXPECT_EQ(0, throttle.available_tokens());
105 time.AdvanceSeconds(1);
106 EXPECT_EQ(100000, throttle.available_tokens());
107 EXPECT_TRUE(throttle.AdmitRequest());
108 EXPECT_EQ(99900, throttle.available_tokens());
109 time.AdvanceSeconds(1);
110 EXPECT_EQ(199900, throttle.available_tokens());
111 throttle.RecordResponse(128000000); // 128 MB response.
112 EXPECT_LT(0, throttle.available_tokens());
113 // Admit request even without available tokens
114 EXPECT_TRUE(throttle.AdmitRequest());
115}
116
117} // namespace
118

Callers

nothing calls this directly

Calls 4

AdvanceSecondsMethod · 0.80
AdmitRequestMethod · 0.80
is_enabledMethod · 0.45
RecordResponseMethod · 0.45

Tested by

no test coverage detected