diff options
author | imarom <imarom@cisco.com> | 2016-05-16 11:55:16 +0300 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-05-16 11:55:16 +0300 |
commit | f98c58425faefba87fb0658f204b6604cfaf1d2a (patch) | |
tree | 625945d12469e2a1b0fca714d907881759a57278 /scripts | |
parent | e75dc535b163329b2c2619a55405924919d42887 (diff) |
fix timeout issue due to race with async response from server
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | 7 |
1 files changed, 5 insertions, 2 deletions
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 391b2076..d209cd64 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 @@ -408,13 +408,16 @@ class Port(object): "force": force} rc = self.transmit("start_traffic", params) - if rc.bad(): - return self.err(rc.err()) + # must set this before to avoid race with the async response self.state = self.STATE_TX + if rc.bad(): + self.state = self.STATE_IDLE + return self.err(rc.err()) return self.ok() + # stop traffic # with force ignores the cached state and sends the command @owned |