Skip to content

Loading…

Port Agent Process Test Fix #398

Merged
merged 1 commit into from

4 participants

@wfrench

When running this test concurrently on multiple builders the test fail because the port is already bound by another process.

Described in:

https://jira.oceanobservatories.org/tasks/browse/OOIION-599

Ran tests successfully:

bin/nosetest ion/agents/port/test/test_port_agent_process.py
bin/nosetest -a SMOKE

@mmeisinger
Ocean Observatories Initiative CI member

is this PR still current to be merged?

@wfrench

Yes, I think it was just waiting on a code review.

@daf

Looks good to me.

@wfrench wfrench merged commit 158d300 into ooici:master
@daf daf commented on the diff
ion/agents/port/test/test_port_agent_process.py
@@ -25,16 +32,16 @@
TEST_TIMEOUT = 2
LOCALHOST = 'localhost'
-DEVICE_ADDR = 'localhost'
-DEVICE_PORT = 4001
+DEVICE_ADDR = CFG.device.sbe37.host
@daf
daf added a note

Actually, thinking more about this: this line (and all these other changes obv) should be of the form:

CFG.get_safe('device.sbe37.host', 'localhost')

That way it's not required to be defined in the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@daf

Sorry I didn't think of this on my first pass. Since this PR is closed, should just make another one I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 10, 2012
  1. @wfrench
Showing with 13 additions and 6 deletions.
  1. +13 −6 ion/agents/port/test/test_port_agent_process.py
View
19 ion/agents/port/test/test_port_agent_process.py
@@ -13,11 +13,18 @@
import unittest
from nose.plugins.attrib import attr
+
+from pyon.public import log
+from pyon.public import CFG
+
+# Pyon unittest support.
+from pyon.util.int_test import IonIntegrationTestCase
+
from ion.agents.port.port_agent_process import PortAgentProcess, PythonPortAgentProcess, UnixPortAgentProcess, PortAgentProcessType
from ion.agents.port.exceptions import PortAgentTimeout
from ion.agents.port.exceptions import PortAgentMissingConfig
from ion.agents.port.exceptions import PortAgentLaunchException
-from pyon.public import CFG
+
# Make tests verbose and provide stdout
# bin/nosetests -s -v ion/agents/port/test/test_port_agent_process.py
@@ -25,16 +32,16 @@
TEST_TIMEOUT = 2
LOCALHOST = 'localhost'
-DEVICE_ADDR = 'localhost'
-DEVICE_PORT = 4001
+DEVICE_ADDR = CFG.device.sbe37.host
@daf
daf added a note

Actually, thinking more about this: this line (and all these other changes obv) should be of the form:

CFG.get_safe('device.sbe37.host', 'localhost')

That way it's not required to be defined in the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+DEVICE_PORT = CFG.device.sbe37.port
PORT_AGENT_BINARY = 'port_agent'
-PORT_AGENT_COMMAND_PORT = 3000
-PORT_AGENT_DATA_PORT = 3001
+PORT_AGENT_COMMAND_PORT = CFG.device.sbe37.port_agent_cmd_port
+PORT_AGENT_DATA_PORT = CFG.device.sbe37.port_agent_data_port
PORT_AGENT_LOG_LEVEL = 5
@attr('HARDWARE', group='mi')
-class TestPythonEthernetProcess(unittest.TestCase):
+class TestPythonEthernetProcess(IonIntegrationTestCase):
"""
Unit tests for the Port Agent Process using python classes
"""
Something went wrong with that request. Please try again.