@@ -380,7 +380,7 @@ TEST_F(Daemon, ensure_that_on_restart_future_completes)
380
380
381
381
// This VM was running before, but not now.
382
382
auto mock_vm = std::make_unique<NiceMock<mpt::MockVirtualMachine>>(" yakety-yak" );
383
- EXPECT_CALL (*mock_vm, current_state).WillOnce (Return (mp::VirtualMachine::State::stopped));
383
+ EXPECT_CALL (*mock_vm, current_state).Times ( 2 ). WillRepeatedly (Return (mp::VirtualMachine::State::stopped));
384
384
EXPECT_CALL (*mock_vm, start).Times (1 );
385
385
386
386
mp::Signal sig;
@@ -413,7 +413,7 @@ TEST_F(Daemon, starts_previously_running_vms_back)
413
413
414
414
// This VM was running before, but not now.
415
415
auto mock_vm = std::make_unique<NiceMock<mpt::MockVirtualMachine>>(vm_props.name );
416
- EXPECT_CALL (*mock_vm, current_state).WillOnce (Return (mp::VirtualMachine::State::stopped));
416
+ EXPECT_CALL (*mock_vm, current_state).Times ( 2 ). WillRepeatedly (Return (mp::VirtualMachine::State::stopped));
417
417
EXPECT_CALL (*mock_vm, start).Times (1 );
418
418
EXPECT_CALL (*mock_vm, update_state).Times (1 );
419
419
EXPECT_CALL (*mock_vm, wait_until_ssh_up).Times (1 );
@@ -434,7 +434,7 @@ TEST_F(Daemon, calls_on_restart_for_already_running_vms_on_construction)
434
434
435
435
// This VM was running before, but not now.
436
436
auto mock_vm = std::make_unique<NiceMock<mpt::MockVirtualMachine>>(vm_props.name );
437
- EXPECT_CALL (*mock_vm, current_state).WillOnce (Return (mp::VirtualMachine::State::running));
437
+ EXPECT_CALL (*mock_vm, current_state).Times ( 2 ). WillRepeatedly (Return (mp::VirtualMachine::State::running));
438
438
EXPECT_CALL (*mock_vm, start).Times (0 );
439
439
EXPECT_CALL (*mock_vm, update_state).Times (1 );
440
440
EXPECT_CALL (*mock_vm, wait_until_ssh_up).Times (1 );
@@ -455,7 +455,7 @@ TEST_F(Daemon, calls_on_restart_for_already_starting_vms_on_construction)
455
455
456
456
// This VM was running before, but not now.
457
457
auto mock_vm = std::make_unique<NiceMock<mpt::MockVirtualMachine>>(vm_props.name );
458
- EXPECT_CALL (*mock_vm, current_state).WillOnce (Return (mp::VirtualMachine::State::starting));
458
+ EXPECT_CALL (*mock_vm, current_state).Times ( 2 ). WillRepeatedly (Return (mp::VirtualMachine::State::starting));
459
459
EXPECT_CALL (*mock_vm, start).Times (0 );
460
460
EXPECT_CALL (*mock_vm, update_state).Times (1 );
461
461
EXPECT_CALL (*mock_vm, wait_until_ssh_up).Times (1 );
0 commit comments