Skip to content

Commit

Permalink
Fix profiler test
Browse files Browse the repository at this point in the history
  • Loading branch information
warunalakshitha committed Oct 8, 2024
1 parent aafc07e commit 4883378
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
public class AsyncUtils {

public static Object handleNonIsolatedStrand(Strand strand, Supplier<?> resultSupplier) {
// This check required for non strand Threads.
boolean runnable = strand.isRunnable();
if (runnable) {
strand.yield();

}
Object result = resultSupplier.get();
if (runnable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ public void testProfilerExecutionWithKillSignal() throws BallerinaTestException
bMainInstance.waitForLeechers(List.of(beforeExecleechers), 20000);
addLogLeechers(afterExecleechers, serverInfoLogReader);
Thread.sleep(5000);
long processId = process.pid();
Runtime.getRuntime().exec("kill -SIGINT " + processId);
ProcessHandle profilerHandle = process.children().findFirst().get().children().findFirst().get();
long profileId = profilerHandle.pid();
long balProcessID = profilerHandle.children().findFirst().get().pid();
Runtime.getRuntime().exec("kill -SIGINT " + balProcessID);
Runtime.getRuntime().exec("kill -SIGINT " + profileId);
bMainInstance.waitForLeechers(List.of(afterExecleechers), 20000);
process.waitFor();
} catch (InterruptedException | IOException e) {
Expand Down

0 comments on commit 4883378

Please sign in to comment.