This test verifies that the status update manager will not retry a terminal status update after it has been acknowledged.
| 140 | // This test verifies that the status update manager will not retry a terminal |
| 141 | // status update after it has been acknowledged. |
| 142 | TEST_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 |
nothing calls this directly
no test coverage detected