Skip to content

minor: use pre-stopped mock instance in e2e tests#3208

Merged
david-crespo merged 1 commit into
mainfrom
mock-stopped-instance
May 2, 2026
Merged

minor: use pre-stopped mock instance in e2e tests#3208
david-crespo merged 1 commit into
mainfrom
mock-stopped-instance

Conversation

@david-crespo
Copy link
Copy Markdown
Collaborator

A bunch of tests (11 tests) have to wait for an instance to stop in order to do things you need to stop the instance to do. If the instance is already stopped it saves like 5 seconds per test. The savings will probably be diluted by 5x parallelism, so it may only save 10 seconds on the full run, but it's probably still worth it.

Several e2e tests stopped db1 purely to bypass a 'must be stopped'
precondition (NIC create, disk attach/detach, boot-disk change, transit
IPs edit). Adds db-stopped (with its own boot/data disks and NIC) and
points 11 such tests at it.

Tests that verify the disabled-while-running state (instance-disks
'Disabled actions', instance-networking 'NIC table', anti-affinity
'add and remove instance from group') keep using db1 + stopInstance.

Wall time on the 11 affected tests dropped ~50% (34s → 17s); sum of
per-test durations dropped ~55% (~117s → ~52s).

Fix tests broken by adding db-stopped mock instance

- disks.e2e.ts: bump expected disk row count from 14 to 16 (+2 stopped disks)
- firewall-rules.e2e.ts: add db-stopped to instance combobox option lists
- instance.e2e.ts: scope 'stopped' text locator to db1's row, since
  db-stopped's row also shows state 'stopped'
@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview May 2, 2026 1:17am

Request Review

@david-crespo
Copy link
Copy Markdown
Collaborator Author

Saves about 20 seconds overall. I’ll take it!

@david-crespo david-crespo merged commit 72996fe into main May 2, 2026
7 checks passed
@david-crespo david-crespo deleted the mock-stopped-instance branch May 2, 2026 02:19
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.

1 participant