Skip to content

[FIX] Clear GcpInstance when restarting a run - #1225

Open
NaitikVerma6776 wants to merge 2 commits into
CCExtractor:masterfrom
NaitikVerma6776:fix/restart-clears-gcp-instance
Open

NaitikVerma6776 wants to merge 2 commits into
CCExtractor:masterfrom
NaitikVerma6776:fix/restart-clears-gcp-instance

Conversation

@NaitikVerma6776

Copy link
Copy Markdown
Contributor

Fixes #1224

What was wrong

Restarting a run (API POST /api/v1/runs/<id>/restart or UI /test/restart_test/<id>) cleared progress and results so the run looked pending again. It left the GcpInstance row in place.

CI treats any test with a GcpInstance as already running:

  • gcp_instance excludes those ids from the pending queue
  • start_test returns early if a row exists

So restarting a running or stuck run never started a new VM.

What this PR does

Delete the GcpInstance row in both restart paths. The old VM, if it is still up, becomes an orphan and can be removed by the existing orphan scanner.

Test plan

  • API restart removes a leftover GcpInstance
  • UI restart removes a leftover GcpInstance

Restart only cleared progress and results, so cron still treated the test as running and never started a new VM.

Fixes CCExtractor#1224
Sonar python:S6663 failed the PR quality gate because MIMEAccept was indexed with a string. Use accept_json instead.
@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Restarting a run leaves GcpInstance, so CI never re-queues it

1 participant