Report instances restored while suspended as restored

What does this MR do?

Keeps the "restored" flag for an instance whose saved state is restored while it is suspended. The StateSuspended branch discarded the flag, so after a Runner restart and resume, UpFunc got Restored=false and GitLab Runner removed the VM it was asked to resume. The instance now records the flag, and the StateRunning branch reads it.

This is fix 2 from gitlab-org/gitlab-runner#40016.

What's the best way to test this MR?

The new test go test -race -run TestResumedInstanceFromPersistedSuspendedStateIsReportedAsRestored . fails on main and passes here. A manual suspend, Runner restart and resume with state_storage on also passed end to end on Azure, for Uniform and Flexible scale sets.

Edited by Ashvin Sharma

Merge request reports

Loading
Loading