Skip to content

Commit

Permalink
Comment out diagnostic print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
orangy committed Dec 6, 2016
1 parent 29dee8c commit 9e8410d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ktor-hosts/ktor-jetty/test/JettyDeadlock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class JettyDeadlockTest {
val e = Executors.newCachedThreadPool()
val q = LinkedBlockingQueue<String>()

println("starting")
//println("starting")
val conns = (0..2000).map { number ->
e.submit(Callable<String> {
try {
URL("http://localhost:$port/").openConnection().inputStream.bufferedReader().readLine().apply {
println("$number says $this")
//println("$number says $this")
} ?: "<empty>"
} catch (t: Throwable) {
"error: ${t.message}"
Expand All @@ -59,15 +59,15 @@ class JettyDeadlockTest {
})
}

println("Main thread is waiting for responses")
//println("Main thread is waiting for responses")

TimeUnit.SECONDS.sleep(5)
var attempts = 7

fun dump() {
val (valid, invalid) = conns.filter { it.isDone }.partition { it.get() == "Help !" }

println("Completed: ${valid.size} valid, ${invalid.size} invalid of ${valid.size + invalid.size} total [attempts $attempts]")
//println("Completed: ${valid.size} valid, ${invalid.size} invalid of ${valid.size + invalid.size} total [attempts $attempts]")
}

while (true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ abstract class HostTestSuite<H : ApplicationHost> : HostTestBase<H>() {

@Test(timeout = 30000L)
fun testBlockingConcurrency() {
println()
//println()
val completed = AtomicInteger(0)

createAndStartServer({
Expand All @@ -904,7 +904,7 @@ abstract class HostTestSuite<H : ApplicationHost> : HostTestBase<H>() {
get("/{index}") {
val index = call.parameters["index"]!!.toInt()
call.respondWrite {
print("[$index] ")
//print("[$index] ")
try {
append("OK:$index\n")
} finally {
Expand All @@ -927,7 +927,7 @@ abstract class HostTestSuite<H : ApplicationHost> : HostTestBase<H>() {
inputStream.reader().use { reader ->
val firstByte = reader.read()
if (firstByte == -1) {
println("Premature end of response stream at iteration $i")
//println("Premature end of response stream at iteration $i")
fail("Premature end of response stream at iteration $i")
} else {
assertEquals('O', firstByte.toChar())
Expand Down

0 comments on commit 9e8410d

Please sign in to comment.