Skip to content

Commit

Permalink
Add delays
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingosse committed Nov 15, 2024
1 parent b36011f commit da6a4bf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
var thread = new Thread(() =>
{
Thread.Sleep(5000); // Add a small delay otherwise the injector leaves a zombie process behind :(
Thread.Sleep(10_000); // Add a small delay otherwise the telemetry forwarder leaves a zombie process behind
throw new BadImageFormatException("Expected");
});

Expand Down
4 changes: 2 additions & 2 deletions lib-injection/build/docker/nodejs/sample-app-node13/child.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
console.log('Child process started');

setTimeout(() => {
console.log('Child process exiting after 5 seconds');
console.log('Child process exiting after 10 seconds');
process.kill(process.pid, 'SIGSEGV');
}, 5000);
}, 10000); // Add a delay before crashing otherwise the telemetry forwarder leaves a zombie behind
4 changes: 2 additions & 2 deletions lib-injection/build/docker/nodejs/sample-app/child.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
console.log('Child process started');

setTimeout(() => {
console.log('Child process exiting after 5 seconds');
console.log('Child process exiting after 10 seconds');
process.kill(process.pid, 'SIGSEGV');
}, 5000);
}, 10000); // Add a delay before crashing otherwise the telemetry forwarder leaves a zombie behind
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def fork_and_crash(request):
return HttpResponse(f"Child process {pid} exited with status {status}")
elif pid == 0:
# Child process
time.sleep(5) # don't crash immediately or the injector leaves a zombie behind
time.sleep(10) # don't crash immediately or the telemetry forwarder leaves a zombie behind
crashme(request)
return HttpResponse("Nobody should see this")

Expand Down
2 changes: 1 addition & 1 deletion tests/auto_inject/test_auto_inject_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_profiling(self, virtual_machine):
class TestContainerAutoInjectInstallScriptCrashTracking_NoZombieProcess(base.AutoInjectBaseTest):
@parametrize_virtual_machines(
bugs=[
{"weblog_variant": "test-app-ruby", "reason": "APMLP-312"},
{"library": "ruby", "reason": "APMLP-312"},
{"weblog_variant": "test-app-java-buildpack", "reason": "APMON-1595"},
]
)
Expand Down

0 comments on commit da6a4bf

Please sign in to comment.