Skip to content

Conversation

@edwintorok
Copy link
Member

@edwintorok edwintorok commented Jan 5, 2026

I intended to write some new VM tests, and the existing VM lifecycle tests looked like a good starting point.

But it turns out that we stopped running this test completely when we dropped the CoreOS template.

Use a memtest ISO instead of the CoreOS template.

Also optimize various startup and shutdown code in quicktest, because even a no-op test that did nothing took 14s to run.

Draft PR, because it needs more testing, and I'm not entirely happy with how the SR filtering works, e.g. this test still won't run if -default-sr is passed (and passing -default-sr is very useful during development because it further cuts down startup time by 5s).

I should then be able to reuse this code in the new tests that I'm writing.

Quicktest was listing potentially thousands of VDIs and querying its
properties, just to find out whether the resulting list was empty or not.

We don't need to produce the full list to check whether it is empty or not: we
can stop once we have the 1st element. Replace the List with a Seq.

Before:
```
time ./quicktest.exe  -run-only Quicktest_vm_lifecycle
[...]
real    0m13.957
```

After:
```
real    0m12.584s
```

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
Some (read-only) SRs can contain a large number of VDIs,
but these cannot "leak" VDIs if we cannot create or destroy them.

Before:
```
real    0m12.584s
```

After:
```
real    0m7.853s
```

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
Before:
```
real 0m7.853s
```

After:
```
real    0m7.746s
```

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
Before:
```
real    0m7.746s
```

After:
```
real    0m6.095s
```

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
The difference is not really measurable.
But I found out there is another pre-existing flag that can speed it up,
`-default-sr`. Then the leak checks are only done on that SR, and not all the
SRs.

So the best way is to run this (at least during development):
```
time ./quicktest.exe -run-only Quicktest_vm_lifecycle -skip-stress -default-sr
[...]
real 0m1.709s
```

Signed-off-by: Edwin Török <edwin.torok@citrix.com>
Signed-off-by: Edwin Török <edwin.torok@citrix.com>
Signed-off-by: Edwin Török <edwin.torok@citrix.com>
Comment on lines 368 to 370
| None ->
Printf.eprintf "Template not found: %S\n" template_name;
Printf.eprintf "Template not found: %S\n" template_name ;
[]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, but this hunk is in the wrong change. It should be in the previous commit.

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.

3 participants