test_mm_domain_limits fails intermittently due to unhandled memory resource limit error (errorCode 535)

Aperta Adatta ai principianti
#13,516 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
testing

Direzione di ricerca

Inizia da test/integration/component/test_mm_domain_limits.py ed esamina test_03_delete_vm, quindi esegui il comando nosetests mirato con la configurazione avanzata del simulatore. Verifica che errorCode 535 venga trattato come un risultato previsto, che gli errori API imprevisti continuino a causare un fallimento e che l’eliminazione venga tentata solo quando la creazione della VM ha esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

component:integration-test status:marvin-tests-failing type:technical-debt
problem

While working on PR #13490, I noticed the Simulator CI / test job intermittently fails on test_mm_domain_limits (test_03_delete_vm).

The test calls deployVirtualMachine, which fails with CloudStack API errorCode 535: "Maximum amount of resources of Type = 'memory' ... is exceeded". Because the VM was never created, the test then attempts to delete a VM that doesn't exist, causing test_03_delete_vm to fail.

The test does not currently handle this resource-limit API error as a valid/expected outcome.

versions

Apache CloudStack version: main branch (4.23.0.0-SNAPSHOT)
Environment: GitHub Actions Simulator CI (advanced zone), simulator hypervisor — not a real deployment

The steps to reproduce the bug
  1. Run the Simulator CI test suite including component/test_mm_domain_limits.py
  2. Observe test_03_delete_vm
  3. deployVirtualMachine fails with errorCode 535 (memory limit exceeded)
  4. Test then attempts to delete a VM that was never created, causing a failure

Can also be reproduced locally with:
nosetests-3.4 --with-marvin --marvin-config=setup/dev/advdualzone.cfg test/integration/component/test_mm_domain_limits.py:test_03_delete_vm -s -a tags=advanced

What to do about it?

Update test_03_delete_vm in test/integration/component/test_mm_domain_limits.py to treat the CloudStack API errorCode 535 (memory resource limit exceeded) as an expected outcome, and only attempt VM deletion if creation succeeded. Example:

try:
vm = VirtualMachine.create(self.apiclient, ...)
vm_created = True
except CloudstackAPIException as ex:
if "errorCode: 535" in str(ex) or "Maximum amount of resources of Type = 'memory'" in str(ex):
vm_created = False
else:
raise

if vm_created:
vm.delete(self.apiclient)

Alternatively, the domain/project memory limit could be raised in test setup if VM creation is expected to succeed in this test.

Lingua principale
Java
Stelle
3.1k
Fork
1.4k
Merge medio
7g 5h
PR unite (30g)
28

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/cloudstack

Tutte le issue di apache/cloudstack

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.