Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
mcculls committed Dec 28, 2024
1 parent fe39745 commit ffca9bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,13 @@ private static void assertProfilingStartupDelayed(final String message) {
}

private static boolean isThreadStarted(final String name, final boolean wait) {
System.out.println("checking for thread " + name + "...");

// Wait up to 10 seconds for thread to appear
for (int i = 0; i < 20; i++) {
for (final Thread thread : Thread.getAllStackTraces().keySet()) {
if (name.equals(thread.getName())) {
System.out.println("...thread " + name + " has started");
return true;
}
}
Expand All @@ -154,6 +157,7 @@ private static boolean isThreadStarted(final String name, final boolean wait) {
e.printStackTrace();
}
}
System.out.println("...thread " + name + " has not started");
return false;
}

Expand All @@ -166,9 +170,12 @@ private static boolean isProfilingStarted(final boolean wait) {
}

private static boolean isTracerInstalled(final boolean wait) {
System.out.println("checking for tracer install...");

// Wait up to 10 seconds for tracer to get installed
for (int i = 0; i < 20; i++) {
if (AgentTracer.isRegistered()) {
System.out.println("...tracer is installed");
return true;
}
if (!wait) {
Expand All @@ -180,6 +187,7 @@ private static boolean isTracerInstalled(final boolean wait) {
e.printStackTrace();
}
}
System.out.println("...tracer is not installed");
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ private static void customAssert(
}

private static boolean isThreadStarted(final String name, final boolean wait) {
System.out.println("checking for thread " + name + "...");

// Wait up to 10 seconds for thread to appear
for (int i = 0; i < 20; i++) {
for (final Thread thread : Thread.getAllStackTraces().keySet()) {
if (name.equals(thread.getName())) {
System.out.println("...thread " + name + " has started");
return true;
}
}
Expand All @@ -79,6 +82,7 @@ private static boolean isThreadStarted(final String name, final boolean wait) {
e.printStackTrace();
}
}
System.out.println("...thread " + name + " has not started");
return false;
}

Expand Down

0 comments on commit ffca9bc

Please sign in to comment.