@@ -380,7 +380,7 @@ TEST_F(Daemon, ensure_that_on_restart_future_completes)
380380
381381 // This VM was running before, but not now.
382382 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));
384384 EXPECT_CALL (*mock_vm, start).Times (1 );
385385
386386 mp::Signal sig;
@@ -413,7 +413,7 @@ TEST_F(Daemon, starts_previously_running_vms_back)
413413
414414 // This VM was running before, but not now.
415415 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));
417417 EXPECT_CALL (*mock_vm, start).Times (1 );
418418 EXPECT_CALL (*mock_vm, update_state).Times (1 );
419419 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)
434434
435435 // This VM was running before, but not now.
436436 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));
438438 EXPECT_CALL (*mock_vm, start).Times (0 );
439439 EXPECT_CALL (*mock_vm, update_state).Times (1 );
440440 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)
455455
456456 // This VM was running before, but not now.
457457 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));
459459 EXPECT_CALL (*mock_vm, start).Times (0 );
460460 EXPECT_CALL (*mock_vm, update_state).Times (1 );
461461 EXPECT_CALL (*mock_vm, wait_until_ssh_up).Times (1 );
0 commit comments