Skip to content

Commit f337782

Browse files
WOnder93pcmoore
authored andcommitted
tests: wait for servers to finish before continuing
When we are starting a new server after killing an old one, there is a possible race condition if the old server takes too long to tear down and the new server fails to bind. I've seen this happen in practice with the sctp test, but let's fix this also in other tests where it makes sense logically. Signed-off-by: Ondrej Mosnacek <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 1a0dc74 commit f337782

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

tests/binder/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ sub service_end {
9898
my $flag = $service . "_flag";
9999

100100
kill KILL, $pid;
101+
waitpid $pid, 0;
101102
system("rm -f $basedir/$flag");
102103
}
103104

tests/inet_socket/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ sub server_end {
4949
my ($pid) = @_;
5050

5151
kill KILL, $pid;
52+
waitpid $pid, 0;
5253
system("rm -f $basedir/flag");
5354
}
5455

tests/sctp/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ sub server_end {
7979
my ($pid) = @_;
8080

8181
kill KILL, $pid;
82+
waitpid $pid, 0;
8283
system("rm -f $basedir/flag");
8384
}
8485

tests/unix_socket/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ sub server_end {
2929
my ($pid) = @_;
3030

3131
kill KILL, $pid;
32+
waitpid $pid, 0;
3233
system("rm -f $basedir/flag");
3334
}
3435

0 commit comments

Comments
 (0)