From 9ab9a3a23b9e8eebe999ba8ee2dae7ce2d9b4194 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 9 May 2022 12:31:15 -0700 Subject: [PATCH] DEBUG --- .github/workflows/pr.yaml | 22 +++---------------- .../TelemetryClientFlushingLogProcessor.java | 7 ++++++ settings.gradle | 3 --- .../default_applicationinsights.json | 3 +++ .../smoketestapp/SpringBootApp.java | 3 +++ .../src/smokeTest/resources/jre.excludes.txt | 2 ++ 6 files changed, 18 insertions(+), 22 deletions(-) create mode 100644 test/smoke/testApps/NonDaemonThreads/src/smokeTest/resources/jre.excludes.txt diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index be5f8ad502c..172ce132a49 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -51,28 +51,12 @@ jobs: with: path: agent/agent/build/libs/applicationinsights-agent-*-SNAPSHOT.jar - setup-smoke-test-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Check out repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Set up JDK 11 for running Gradle - uses: actions/setup-java@v1 - with: - java-version: 11 - - id: set-matrix - # "grep -v skipWinNative" is used to skip the warning message "Skipping build of :etw:native because skipWinNative=true" - run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q :test:smoke:testApps:listTestApps | grep -v skipWinNative | xargs echo | sed 's/ /","/g')\"]}" - smoke-test: - needs: setup-smoke-test-matrix runs-on: ubuntu-latest strategy: - matrix: ${{fromJson(needs.setup-smoke-test-matrix.outputs.matrix)}} + matrix: + module: + - ":test:smoke:testApps:NonDaemonThreads" fail-fast: false steps: - name: Check out repository diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/TelemetryClientFlushingLogProcessor.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/TelemetryClientFlushingLogProcessor.java index ead99347d4c..227bf7a6fbc 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/TelemetryClientFlushingLogProcessor.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/TelemetryClientFlushingLogProcessor.java @@ -43,8 +43,11 @@ public void emit(LogData logData) { } @Override + @SuppressWarnings("SystemOut") public CompletableResultCode shutdown() { + System.out.println("LOG FLUSH"); + // TODO? de-dupe flushing of TelemetryClient three times for spans, logs and metrics // see /~https://github.com/open-telemetry/opentelemetry-java/issues/4416 @@ -52,6 +55,7 @@ public CompletableResultCode shutdown() { } @Override + @SuppressWarnings("SystemOut") public CompletableResultCode forceFlush() { CompletableResultCode overallResult = new CompletableResultCode(); CompletableResultCode delegateResult = delegate.forceFlush(); @@ -62,12 +66,15 @@ public CompletableResultCode forceFlush() { telemetryClientResult.whenComplete( () -> { if (telemetryClientResult.isSuccess()) { + System.out.println("OVERALL SUCCESS"); overallResult.succeed(); } else { + System.out.println("OVERALL FAIL"); overallResult.fail(); } }); } else { + System.out.println("OVERALL FAIL"); overallResult.fail(); } }); diff --git a/settings.gradle b/settings.gradle index c780777a7e4..b003e71f9c1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -69,9 +69,6 @@ include(":dependencyManagement") // Projects for smokeTests include ':test:smoke' include ':test:smoke:appServers' -include ':test:smoke:appServers:Tomcat.8.5' -include ':test:smoke:appServers:Wildfly.11' -include ':test:smoke:appServers:Jetty.9' include ':test:smoke:appServers:JavaSE' include ':test:smoke:testApps' diff --git a/test/smoke/appServers/global-resources/default_applicationinsights.json b/test/smoke/appServers/global-resources/default_applicationinsights.json index 386eae55ff2..a5ee98cab66 100644 --- a/test/smoke/appServers/global-resources/default_applicationinsights.json +++ b/test/smoke/appServers/global-resources/default_applicationinsights.json @@ -3,5 +3,8 @@ "role": { "name": "testrolename", "instance": "testroleinstance" + }, + "selfDiagnostics": { + "level": "debug" } } diff --git a/test/smoke/testApps/NonDaemonThreads/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java b/test/smoke/testApps/NonDaemonThreads/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java index 923d8ef1cae..52ce6c9020a 100644 --- a/test/smoke/testApps/NonDaemonThreads/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java +++ b/test/smoke/testApps/NonDaemonThreads/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java @@ -33,9 +33,12 @@ public class SpringBootApp { private static final Logger logger = LoggerFactory.getLogger("smoketestapp"); public static void main(String[] args) throws IOException { + System.out.println("HELLO FROM MAIN"); if (args.length == 1 && args[0].equals("okhttp3")) { + System.out.println("HELLO FROM FORK"); okHttp3(); logger.info("done"); + System.out.println("LOGGED!"); return; } SpringApplication.run(SpringBootApp.class, args); diff --git a/test/smoke/testApps/NonDaemonThreads/src/smokeTest/resources/jre.excludes.txt b/test/smoke/testApps/NonDaemonThreads/src/smokeTest/resources/jre.excludes.txt new file mode 100644 index 00000000000..15fc841c071 --- /dev/null +++ b/test/smoke/testApps/NonDaemonThreads/src/smokeTest/resources/jre.excludes.txt @@ -0,0 +1,2 @@ +azul/zulu-openjdk:8 +azul/zulu-openjdk:11