Skip to content

Run management server shutdown smoke test last - #230

Open
andrijapanicsb wants to merge 1 commit into
shapeblue:masterfrom
andrijapanicsb:fix/run-management-shutdown-test-last
Open

andrijapanicsb wants to merge 1 commit into
shapeblue:masterfrom
andrijapanicsb:fix/run-management-shutdown-test-last

Conversation

@andrijapanicsb

Copy link
Copy Markdown
Contributor

Problem

test_ms_maintenance_and_safe_shutdown.py intentionally shuts down a CloudStack management server.

The test currently runs in the normal alphabetical smoke-test sequence. It assumes that previously submitted asynchronous jobs have completed before triggerShutdown is called, but the Trillian cleanup process uses non-blocking CloudStack API operations.

This creates a race condition:

  1. Cleanup from an earlier test may leave an asynchronous job running.
  2. CloudStack correctly delays management server shutdown until all pending jobs have completed.
  3. The smoke test waits only 300 seconds for the server to stop.
  4. Some CloudStack operations, including network lock acquisition, may wait for up to 600 seconds.
  5. The test can therefore time out and call service cloudstack-management start before the server has actually stopped.
  6. When the pending job eventually finishes, the management server shuts down after the test has already continued.
  7. The remaining smoke tests then fail with HTTP 503 or connection errors.

This is timing-dependent and is not related to management server startup performance.

In an observed run, a pending DeleteNetworkCmd waited 600 seconds for a network lock. The shutdown test timed out after 300 seconds, and the management server stopped shortly afterwards, leaving the rest of the suite without a working API endpoint.

Change

Remove test_ms_maintenance_and_safe_shutdown.py from the normal test list and append it after all other smoke tests, including the existing host maintenance and host HA tests.

Apply the same ordering in both the legacy smoke-test runner and the generic test runner.

Result

The test still runs and its failures remain visible in the final xUnit results, but an unsuccessful management server recovery can no longer invalidate the results of subsequent smoke tests.

This is an execution-ordering change only. The CloudStack test itself and its assertions are not modified.

Validation

  • Verified that regular tests retain their existing order.
  • Verified that host maintenance and host HA remain at the end.
  • Verified that test_ms_maintenance_and_safe_shutdown.py is the final test file.
  • git diff --check passes.

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