Skip to content

Commit 7e5f82a

Browse files
committed
fix tests
1 parent 6316ab6 commit 7e5f82a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStreamTest.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package datadog.trace.bootstrap.instrumentation.buffer
22

33
import datadog.trace.test.util.DDSpecification
4-
import org.apache.commons.io.IOUtils
54

65
class InjectingPipeOutputStreamTest extends DDSpecification {
76
static class GlitchedOutputStream extends FilterOutputStream {
@@ -67,7 +66,11 @@ class InjectingPipeOutputStreamTest extends DDSpecification {
6766
}
6867
}
6968
} finally {
70-
IOUtils.closeQuietly(piped) // it can throw when draining at close
69+
// it can throw when draining at close
70+
try {
71+
piped.close()
72+
} catch (IOException ignored) {
73+
}
7174
}
7275
then:
7376
assert baos.toByteArray() == expected.getBytes("UTF-8")

dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriterTest.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package datadog.trace.bootstrap.instrumentation.buffer
22

33
import datadog.trace.test.util.DDSpecification
4-
import org.apache.commons.io.IOUtils
54

65
class InjectingPipeWriterTest extends DDSpecification {
76
static class GlitchedWriter extends FilterWriter {
@@ -83,7 +82,11 @@ class InjectingPipeWriterTest extends DDSpecification {
8382
}
8483
}
8584
} finally {
86-
IOUtils.closeQuietly(piped) // it can throw when draining at close
85+
// it can throw when draining at close
86+
try {
87+
piped.close()
88+
} catch (IOException ignored) {
89+
}
8790
}
8891
then:
8992
assert writer.toString() == expected

0 commit comments

Comments
 (0)