Skip to content

Commit dfbff2d

Browse files
Wait for process completion for sflow script (#15809)
The process.terminate() is sending SIGTERM to sflow but there is a missing process.wait() to wait for process to exit. So, likelly the file content was buffered and not fully written by the time we open the file for reading
1 parent 6c2ceab commit dfbff2d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ansible/roles/test/files/ptftests/py3/sflow_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def read_data(self, collector, event, sflow_port=['6343']):
119119
threading.current_thread().getName(), event_is_set))
120120

121121
process.terminate()
122+
process.wait()
122123
f.close()
123124
with open(outfile, 'r') as sflow_data:
124125
for line in sflow_data:

0 commit comments

Comments
 (0)