Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,19 @@ protected String requestContainerHttpServlet(String servletPath, String host, in
StringBuilder lines = new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));

while ((line = br.readLine()) != null && line.length() > 0) {
lines.append(line).append(sep);
int lineNum = 0;
while ((line = br.readLine()) != null) {
lineNum++;
Log.info(c, "requestContainerHttpServlet", String.format("Line %d (length=%d): [%s]", lineNum, line.length(), line));
if (line.length() > 0) {
lines.append(line).append(sep);
}
}
Log.info(c, "requestContainerHttpServlet", String.format("Total lines read: %d, StringBuilder length: %d", lineNum, lines.length()));

// while ((line = br.readLine()) != null && line.length() > 0) {
// lines.append(line).append(sep);
// }
return lines.toString();
} catch (IOException e) {
Log.info(c, "requestContainerHttpServlet", "Encountered IO exception " + e);
Expand Down Expand Up @@ -105,7 +115,7 @@ protected void checkStrings(String metricsText, String[] expectedString) {
* @param expectedString String array of expected strings
*/
protected void matchStringsWithRetries(Supplier<String> metricsOutput, String[] expectedString) throws InterruptedException {
matchStringsWithRetries(metricsOutput, expectedString, 5);
matchStringsWithRetries(metricsOutput, expectedString, 20);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ public void connectionPoolTest() throws Exception {
"io_openliberty_connection_pool_connection_use_time_seconds_bucket\\{instance=\"[a-zA-Z0-9-]*\",io_openliberty_datasource_name=\"jdbc/exampleDS2\",job=\"unknown_service\",le=\"\\+Inf\"\\}.*",
"io_openliberty_connection_pool_connection_use_time_seconds_sum\\{instance=\"[a-zA-Z0-9-]*\",io_openliberty_datasource_name=\"jdbc/exampleDS2\",job=\"unknown_service\"\\}.*",
"io_openliberty_connection_pool_connection_use_time_seconds_count\\{instance=\"[a-zA-Z0-9-]*\",io_openliberty_datasource_name=\"jdbc/exampleDS2\",job=\"unknown_service\"\\}.*"});

Assert.fail("Failing on purpose.");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,7 @@ public void threadPoolAndRequestTimingMetricsTest() throws Exception {
"io_openliberty_request_timing_slow.*",
"io_openliberty_request_timing_hung.*",
"io_openliberty_request_timing_processed.*"});

Assert.fail("Failing on purpose.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public void sessionsMetricTest() throws Exception { // -Dglobal.debug.java2.sec=
"io_openliberty_session_active\\{instance=\"[a-zA-Z0-9-]*\",io_openliberty_app_name=\"default_host/testSessionApp\",job=\"unknown_service\"\\}.*",
"io_openliberty_session_invalidated_total\\{instance=\"[a-zA-Z0-9-]*\",io_openliberty_app_name=\"default_host/testSessionApp\",job=\"unknown_service\"\\}.*",
"io_openliberty_session_invalidated_by_timeout_total\\{instance=\"[a-zA-Z0-9-]*\",io_openliberty_app_name=\"default_host/testSessionApp\",job=\"unknown_service\"\\}.*" });


Assert.fail("Failing on purpose.");
}


Expand Down