]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
qa/tasks/mgr: bounce the mgrs once per test class 70097/head
authorKefu Chai <k.chai@proxmox.com>
Fri, 10 Jul 2026 03:08:40 +0000 (11:08 +0800)
committerKefu Chai <k.chai@proxmox.com>
Fri, 10 Jul 2026 05:54:32 +0000 (13:54 +0800)
commit4af78378a9d646853e78c5c9ce7aa6141d12d3fa
treeeb8d993ee45f9f7f8b248e587cd46ba3ab544f3c
parent30849c11963367840717bcd9226f0f0eff91873f
qa/tasks/mgr: bounce the mgrs once per test class

The dashboard backend API suite occasionally fails in CI on the job's
7200 second timeout alone, with every test passing. Suite runtime
varies with builder load: identical runs of the same 311 tests took
anywhere from about 5400 to over 7000 seconds, and teardown needs
roughly another 180 seconds on top. On the runs that landed at the
high end, only 60 to 80 seconds of margin were left before the
timeout fired. Cutting setup overhead gives the suite that margin
back.

DashboardTestCase.setUpClass() restarted every mgr twice: once in
MgrTestCase.setup_mgrs(), and again right after in _assign_ports(),
whose only job is to set the per-mgr dashboard port, which has to
happen while the mgrs are down.

Let subclasses declare their module ports in a MODULE_PORTS class
attribute instead. setup_mgrs() assigns them while the daemons are
already stopped, so the single restart it performs picks them up and
the second stop/fail/restart cycle disappears.

The assignment loop moves to _assign_module_ports(). _assign_ports()
keeps its old stop/assign/restart contract for callers that reassign
ports outside class setup (test_prometheus, test_dashboard,
test_module_selftest) and delegates to the shared helper.

With 66 dashboard test classes per API suite run this removes one
full mgr bounce per class, roughly 10 to 15 minutes of wall clock in
the CI runs examined.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
qa/tasks/mgr/dashboard/helper.py
qa/tasks/mgr/mgr_test_case.py