-
Notifications
You must be signed in to change notification settings - Fork 931
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replicate failing to open port on Windows
- Loading branch information
1 parent
973cd63
commit 3621404
Showing
3 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* sbt | ||
* Copyright 2011 - 2018, Lightbend, Inc. | ||
* Copyright 2008 - 2010, Mark Harrah | ||
* Licensed under Apache License 2.0 (see LICENSE) | ||
*/ | ||
|
||
package xsbt | ||
|
||
import org.scalatest.flatspec.AnyFlatSpec | ||
import org.scalatest.matchers.should.Matchers._ | ||
|
||
class IPCSpec extends AnyFlatSpec { | ||
"server" should "find free open ports and close them" in { | ||
noException should be thrownBy { | ||
val server = IPC.unmanagedServer | ||
(1 until 500).foreach { index => | ||
try { | ||
IPC.client(server.port)(identity) | ||
} catch { | ||
case e: Throwable => | ||
val message = s"failure index is $index" | ||
info(message) | ||
throw e | ||
} | ||
} | ||
server.close() | ||
} | ||
} | ||
} |