From 6dac5c0b4617c3d5f0a7fd2cb2b2b2dfdce6f4ba Mon Sep 17 00:00:00 2001 From: imarom Date: Tue, 17 May 2016 11:20:57 +0300 Subject: timeout fix - two bugs in two lines of code :-( ... now it should be ok --- .../trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py index d209cd64..be46e95f 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py @@ -406,13 +406,15 @@ class Port(object): "mul": mul, "duration": duration, "force": force} - - rc = self.transmit("start_traffic", params) - + # must set this before to avoid race with the async response + last_state = self.state self.state = self.STATE_TX + + rc = self.transmit("start_traffic", params) + if rc.bad(): - self.state = self.STATE_IDLE + self.state = last_state return self.err(rc.err()) return self.ok() -- cgit