I am attempting to contribute to maas and am working on fixing some tests. I am doing my development on a vagrant box with the following vagrant file
Vagrant.configure('2') do |config|
config.vm.box = 'bento/ubuntu-18.04'
config.vm.provision 'shell', inline: <<-SHELL
cd /vagrant
sudo apt-get update
make install-dependencies
./utilities/configure-lxd-profile
SHELL
end
The HACKING.rst
document specifies that individual tests can be run by passing ./bin/test.region path/to/test/file
However, when I run the following, every test fails with a twisted.internet.error.ReactorAlreadyRunning
error
vagrant@vagrant:/vagrant$ ./bin/test.region src/provisioningserver/drivers/power/tests/test_redfish.py
...
======================================================================
ERROR: provisioningserver.drivers.power.tests.test_redfish.TestRedfishPowerDriver.test_redfish_request_retries_404s_trailing_slash
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/nose/case.py", line 133, in run
self.runTest(result)
File "/usr/lib/python3/dist-packages/nose/case.py", line 151, in runTest
test(result)
File "/vagrant/src/maastesting/testcase.py", line 279, in __call__
super(MAASTestCase, self).__call__(result)
File "/vagrant/src/maastesting/scenarios.py", line 34, in __call__
super(WithScenarios, self).__call__(result)
File "/home/vagrant/.buildout/eggs/unittest2-1.1.0-py3.6.egg/unittest2/case.py", line 673, in __call__
return self.run(*args, **kwds)
File "/vagrant/src/maastesting/testcase.py", line 275, in run
super(MAASTestCase, self).run(result)
File "/home/vagrant/.buildout/eggs/testscenarios-0.5.0-py3.6.egg/testscenarios/testcase.py", line 65, in run
return super(WithScenarios, self).run(result)
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/testcase.py", line 671, in run
return run_test.run(result)
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/runtest.py", line 80, in run
return self._run_one(actual_result)
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/runtest.py", line 94, in _run_one
return self._run_prepared_result(ExtendedToOriginalDecorator(result))
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/runtest.py", line 108, in _run_prepared_result
self._run_core()
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/twistedsupport/_runtest.py", line 432, in _run_core
spinner)
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/twistedsupport/_runtest.py", line 393, in _blocking_run_deferred
spinner.run, self._timeout, self._run_deferred)
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/twistedsupport/_spinner.py", line 77, in trap_unhandled_errors
result = function(*args, **kwargs)
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/twistedsupport/_spinner.py", line 49, in decorated
return function(*args, **kwargs)
File "/home/vagrant/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/twistedsupport/_spinner.py", line 295, in run
self._reactor.run()
File "/usr/lib/python3/dist-packages/twisted/internet/asyncioreactor.py", line 266, in run
self.startRunning(installSignalHandlers=installSignalHandlers)
File "/usr/lib/python3/dist-packages/twisted/internet/base.py", line 1222, in startRunning
ReactorBase.startRunning(self)
File "/usr/lib/python3/dist-packages/twisted/internet/base.py", line 728, in startRunning
raise error.ReactorAlreadyRunning()
twisted.internet.error.ReactorAlreadyRunning
These tests do not fail with this error when running make test
. Is there some additional setup needed in order to run the granular tests? It would really speed up my iteration time.