Skip to content

Commit

Permalink
Ensure UNIX socket paths do not already exist in $*TMPDIR before testing
Browse files Browse the repository at this point in the history
Otherwise tests will explode if they do.
  • Loading branch information
Kaiepi committed Apr 10, 2021
1 parent 9390d06 commit b94756d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions S32-io/IO-Socket-INET-UNIX.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ if $*DISTRO.is-win {
my IO::Socket::INET:_ $server;
my IO::Socket::INET:_ $client;
my IO::Socket::INET:_ $accepted;
my Str:D $host = "./test-$*PID.sock";
my Str:_ $host;
my Str:D $sent = 'Hello, world!';
my Str:_ $received;
LEAVE $host.IO.unlink if $host.IO.e;

repeat { $host = "./test-$*PID" ~ $++ ~ ".sock" } while $host.IO.e;
LEAVE $host.IO.unlink if $host andthen .IO.e;

lives-ok {
$server = IO::Socket::INET.listen: $host, 0, family => PF_UNIX;
Expand Down

0 comments on commit b94756d

Please sign in to comment.