maas-devel team mailing list archive
-
maas-devel team
-
Mailing list archive
-
Message #01743
Analysis of slow test suite
The tests are currently taking 30 minutes to run instead of the old 7
minutes. So, I finally got profiling to work with a bit of a hack:
python -m cProfile bin/test.maas
which spits out some profile stats for us in stdout.
There is no surprise in that the thing we suspected was slow, is indeed
the slow thing.
The new Nodegroupinterface.clean_ip_ranges() is, unfortunately, not as
good as gmb and I had hoped. It's using IPSet which is doing dumb stuff
and 238 seconds of the suite run time are spent in there now. It needs
improving fast - or we need to regulate the test input to use smaller sets.
This has had a huge knock-on effect because factory.make_node() ends up
calling this code (when it adds a nodegroup/nodegroupinterface to the node).
It's also obvious that there's some crazy slow individual tests in this
suite, for example:
10 seconds:
test_node.py:376(test_set_random_hostname_checks_hostname_existence)
15 seconds:
test_node.py:1261(test_get_nodes_with_edit_perm_admin_lists_all_nodes)
We can look at those later.
Follow ups