A test modules final cleanup method in its module level fixture fails when -
test module's fixture use volttron_instance fixture and
also does a bunch of agent stop and remove in its own fixture's cleanup method
test module's fixture fails at agent uninstall or agent remove with Remote Error "volttron instance is not running" . This happens because volttron_instance fixture's cleanup method is called before the completion of test module fixture
To Reproduce
Steps to reproduce the behavior:
Create test, say, test_fixture_cleanup.py
Create module level fixture, say test_fixture, that
uses volttrontesting.fixtures.volttron_platform_fixtures.volttron_instance fixture as an argument.
installs any two volttron agent in this volttron_instance
yields the agent id
add a cleanup logic - call volttron_instance.stop_agent(agent1), volttron_instance.stop_agent(agent2), volttron_instance.remove_agent(agent1), volttron_instance.remove_agent(agent2)
create a dummy test method that has module level fixture, test_fixture, as input
Run the test module
Expected behavior
Test and cleanup should finish successfully. Agents should get installed before the start of the test, test method should pass, agents should get stopped and uninstalled successfully in the test_fixture's cleanup part, and only after this volttron_instance fixture's cleanup should get called. volttron_instance fixture's cleanup should shutdown volttron_instance
Describe the bug
A test modules final cleanup method in its module level fixture fails when -
test module's fixture fails at agent uninstall or agent remove with Remote Error "volttron instance is not running" . This happens because volttron_instance fixture's cleanup method is called before the completion of test module fixture
To Reproduce Steps to reproduce the behavior:
Expected behavior Test and cleanup should finish successfully. Agents should get installed before the start of the test, test method should pass, agents should get stopped and uninstalled successfully in the test_fixture's cleanup part, and only after this volttron_instance fixture's cleanup should get called. volttron_instance fixture's cleanup should shutdown volttron_instance