I intend to fix this by changing instance.save() such that it will:
1. return the expected InstanceUpdateConflict directly without hitting the db if instance.task_state doesn't match expected_task_state.
2. assert that task state is being changed if expected_task_state is set (this would be a programming error).
3. ditto for vm_state.
I believe unit test coverage in test_instance will be sufficient for this change.
I intend to fix this by changing instance.save() such that it will:
1. return the expected InstanceUpdateC onflict directly without hitting the db if instance.task_state doesn't match expected_ task_state.
2. assert that task state is being changed if expected_task_state is set (this would be a programming error).
3. ditto for vm_state.
I believe unit test coverage in test_instance will be sufficient for this change.