99#include " external/envoy/test/mocks/local_info/mocks.h"
1010#include " external/envoy/test/mocks/protobuf/mocks.h"
1111#include " external/envoy/test/mocks/thread_local/mocks.h"
12+ #include " external/envoy/test/test_common/simulated_time_system.h"
1213
1314#include " common/statistic_impl.h"
1415
@@ -74,11 +75,6 @@ class ClientWorkerTest : public Test {
7475 TerminationPredicatePtr createMockTerminationPredicate () {
7576 auto predicate = std::make_unique<NiceMock<MockTerminationPredicate>>();
7677 ON_CALL (*predicate, appendToChain (_)).WillByDefault (ReturnRef (*predicate));
77- EXPECT_CALL (*predicate, evaluateChain ())
78- .Times (AtLeast (0 ))
79- .WillOnce (Return (TerminationPredicate::Status::PROCEED))
80- .WillOnce (Return (TerminationPredicate::Status::TERMINATE));
81-
8278 return predicate;
8379 }
8480
@@ -91,7 +87,7 @@ class ClientWorkerTest : public Test {
9187 MockRequestSourceFactory request_generator_factory_;
9288 Envoy::Stats::IsolatedStoreImpl store_;
9389 NiceMock<Envoy::ThreadLocal::MockInstance> tls_;
94- Envoy::Event::TestRealTimeSystem time_system_;
90+ Envoy::Event::SimulatedTimeSystem time_system_;
9591 MockBenchmarkClient* benchmark_client_;
9692 MockSequencer* sequencer_;
9793 MockRequestSource* request_generator_;
@@ -112,8 +108,7 @@ TEST_F(ClientWorkerTest, BasicTest) {
112108 InSequence dummy;
113109 EXPECT_CALL (*benchmark_client_, setShouldMeasureLatencies (false )).Times (1 );
114110 EXPECT_CALL (*benchmark_client_, tryStartRequest (_))
115- .Times (1 )
116- .WillRepeatedly (Invoke (this , &ClientWorkerTest::CheckThreadChanged));
111+ .WillOnce (Invoke (this , &ClientWorkerTest::CheckThreadChanged));
117112 EXPECT_CALL (*benchmark_client_, setShouldMeasureLatencies (true )).Times (1 );
118113 EXPECT_CALL (*sequencer_, start).Times (1 );
119114 EXPECT_CALL (*sequencer_, waitForCompletion).Times (1 );
@@ -124,8 +119,7 @@ TEST_F(ClientWorkerTest, BasicTest) {
124119 auto worker = std::make_unique<ClientWorkerImpl>(
125120 *api_, tls_, cluster_manager_ptr_, benchmark_client_factory_, termination_predicate_factory_,
126121 sequencer_factory_, request_generator_factory_, store_, worker_number,
127- time_system_.monotonicTime () + 10ms, http_tracer_,
128- ClientWorkerImpl::HardCodedWarmupStyle::ON);
122+ time_system_.monotonicTime (), http_tracer_, ClientWorkerImpl::HardCodedWarmupStyle::ON);
129123
130124 worker->start ();
131125 worker->waitForCompletion ();
0 commit comments