diff --git a/src/main/java/com/datadoghq/datadog_lambda_java/Extension.java b/src/main/java/com/datadoghq/datadog_lambda_java/Extension.java index 8313e24..e2a4b1d 100644 --- a/src/main/java/com/datadoghq/datadog_lambda_java/Extension.java +++ b/src/main/java/com/datadoghq/datadog_lambda_java/Extension.java @@ -28,7 +28,7 @@ protected static boolean setup() { protected static void flush() { if(!hitFlushRoute(AGENT_URL, FLUSH_PATH)) { - DDLogger.getLoggerImpl().debug("Could not call the flush routeg"); + DDLogger.getLoggerImpl().debug("Could not call the flush route"); } } diff --git a/src/test/java/com/datadoghq/datadog_lambda_java/CustomMetricTest.java b/src/test/java/com/datadoghq/datadog_lambda_java/CustomMetricTest.java index a1ba4eb..7456bca 100644 --- a/src/test/java/com/datadoghq/datadog_lambda_java/CustomMetricTest.java +++ b/src/test/java/com/datadoghq/datadog_lambda_java/CustomMetricTest.java @@ -82,22 +82,24 @@ public void run() { } }).start(); - ddm.write(); - - int i = 0; - for(; i < 10; ++i) { - try { - if (null== text[0] || text[0].equals("notYetReceived")) { + try { + Thread.sleep(1000); + ddm.write(); + int i = 0; + for (; i < 10; ++i) { + if (null == text[0] || text[0].equals("notYetReceived")) { Thread.sleep(1000); } else { assertTrue(text[0].startsWith("foo:24.3|d|#firsttag:firsttagvaluesecondtag:100.34")); break; } - } catch (InterruptedException e) { + } + + if (i == 10) { fail(); } } - if( i == 10) { + catch (InterruptedException e) { fail(); } }