MCPcopy Create free account
hub / github.com/apache/mesos / TEST_F

Function TEST_F

src/tests/operation_status_update_manager_tests.cpp:142–173  ·  view source on GitHub ↗

This test verifies that the status update manager will not retry a terminal status update after it has been acknowledged.

Source from the content-addressed store, hash-verified

140// This test verifies that the status update manager will not retry a terminal
141// status update after it has been acknowledged.
142TEST_F(OperationStatusUpdateManagerTest, UpdateAndAck)
143{
144 Future<UpdateOperationStatusMessage> forwardedStatusUpdate;
145 EXPECT_CALL(statusUpdateProcessor, update(_))
146 .WillOnce(FutureArg<0>(&forwardedStatusUpdate));
147
148 const id::UUID operationUuid = id::UUID::random();
149 const id::UUID statusUuid = id::UUID::random();
150
151 UpdateOperationStatusMessage statusUpdate =
152 createUpdateOperationStatusMessage(
153 statusUuid, operationUuid, OperationState::OPERATION_FINISHED);
154
155 // Send a checkpointed operation status update.
156 AWAIT_ASSERT_READY(statusUpdateManager->update(statusUpdate, true));
157
158 UpdateOperationStatusMessage expectedStatusUpdate(statusUpdate);
159 expectedStatusUpdate.mutable_latest_status()->CopyFrom(statusUpdate.status());
160
161 // Verify that the status update is forwarded.
162 AWAIT_EXPECT_EQ(expectedStatusUpdate, forwardedStatusUpdate);
163
164 // Acknowledge the update, this is a terminal update, so `acknowledgement`
165 // should return `false`.
166 AWAIT_EXPECT_FALSE(
167 statusUpdateManager->acknowledgement(operationUuid, statusUuid));
168
169 // Advance the clock, the status update has been acknowledged, so it shouldn't
170 // trigger a retry.
171 Clock::advance(slave::STATUS_UPDATE_RETRY_INTERVAL_MIN);
172 Clock::settle();
173}
174
175
176// This test verifies that the status update manager will not retry a

Callers

nothing calls this directly

Calls 15

randomFunction · 0.85
CopyFromMethod · 0.80
isReadyMethod · 0.80
atMethod · 0.80
updateFunction · 0.50
existsFunction · 0.50
openFunction · 0.50
ftruncateFunction · 0.50
closeFunction · 0.50
rmFunction · 0.50
writeFunction · 0.50

Tested by

no test coverage detected