'Test we cannot claim a work if we lose race condition.'

@mock.patch('cinder.db.worker_create', autospec=True)
@mock.patch('cinder.db.worker_get', autospec=True)
def test_set_worker_race_condition_fail(self, mock_get, mock_create):

    service.Service.service_id = mock.sentinel.service_id
    mock_get.side_effect = exception.WorkerNotFound
    mock_create.side_effect = exception.WorkerExists(type='type', id='id')
    backup = Backup(_context=self.context, status=mock.sentinel.status, id=mock.sentinel.id)
    self.assertRaises(exception.CleanableInUse, backup.set_worker)
    self.assertTrue(mock_get.called)
    self.assertTrue(mock_create.called)
