Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't import agent into the global space for tests. #3137

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion volttrontesting/fixtures/volttron_platform_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def volttron_instance(request, **kwargs):
"""
address = kwargs.pop("vip_address", get_rand_vip())
if request.param['messagebus'] == 'rmq':
kwargs['timeout'] = 120
kwargs['timeout'] = 240

wrapper = build_wrapper(address,
messagebus=request.param.get('messagebus', 'zmq'),
Expand Down
5 changes: 3 additions & 2 deletions volttrontesting/utils/build_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import gevent

from volttron.platform.keystore import KeyStore
from volttron.platform.vip.agent import Agent
from volttrontesting.utils.platformwrapper import PlatformWrapper


Expand All @@ -13,9 +12,11 @@ def build_agent(platform: PlatformWrapper, identity=None, agent_class=None):
The agent identity will be set. If the identity is set to None
then a random identity will be created.
"""
from volttron.platform.vip.agent import Agent

if agent_class is None:
agent_class = Agent

os.environ['VOLTTRON_HOME'] = platform.volttron_home
agent = platform.build_agent(identity, agent_class=agent_class)
gevent.sleep(0.1) # switch context for a bit
Expand Down
Loading