Fix flaky http url connection test (#7724)
https://ge.opentelemetry.io/s/2x656dnceehhk/tests/:instrumentation:http-url-connection:javaagent:test/io.opentelemetry.javaagent.instrumentation.httpurlconnection.HttpUrlConnectionTest/traceRequest(boolean)%5B1%5D?top-execution=1
This commit is contained in:
parent
2277092d82
commit
0bd4af09ea
|
@ -7,7 +7,6 @@ package io.opentelemetry.javaagent.instrumentation.httpurlconnection;
|
||||||
|
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -19,9 +18,9 @@ final class StreamUtils {
|
||||||
static List<String> readLines(InputStream stream) throws IOException {
|
static List<String> readLines(InputStream stream) throws IOException {
|
||||||
List<String> lines = new ArrayList<>();
|
List<String> lines = new ArrayList<>();
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(stream, UTF_8));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(stream, UTF_8));
|
||||||
while (reader.ready()) {
|
String line;
|
||||||
String line = reader.readLine();
|
while ((line = reader.readLine()) != null) {
|
||||||
if (!Strings.isNullOrEmpty(line)) {
|
if (!line.isEmpty()) {
|
||||||
lines.add(line);
|
lines.add(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue