'This test simulates a spawn failure with no retry data.
If driver spawn raises an exception and there is no retry data
available, the instance fault message should not contain any details
about rescheduling. The fault message field is limited in size and a
long message about rescheduling displaces the original error message.'

def test_instance_fault_message_no_rescheduled_details_without_retry(self):

    class TestException(Exception, ):
        pass
    instance = self._create_fake_instance_obj()
    with mock.patch.object(self.compute.driver, 'spawn') as mock_spawn:
        mock_spawn.side_effect = TestException('Preserve    this')
        self.compute.build_and_run_instance(self.context, instance, {}, {}, {}, block_device_mapping=[])
    self.assertEqual('Preserve    this', instance.fault.message)
