You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(auto-instrumentations-node): reproduce blocking process termination
This adds a (currently failing) test to verify that the automatic SDK
shutdown at process end does not inadvertently block process termination
for too long.
@@ -106,5 +132,39 @@ describe('Register', function () {
106
132
107
133
// Check a span has been generated for the GET request done in app.js
108
134
assert.ok(stdout.includes("name: 'GET'"),'console span output in stdout');
135
+
136
+
// Verify that the SDK shutdown does not block termination of the process.
137
+
awaitPromise.race([exitPromise,errorPromise]);
138
+
assert.ok(
139
+
appTerminationTook<appTerminationThreshold,
140
+
`The application under test terminated ${appTerminationTook} ms after sending SIGTERM, exceeding the allowed threshold of ${appTerminationThreshold} ms.`
141
+
);
142
+
});
143
+
144
+
it('does not block process termination',async()=>{
// Verify that the SDK shutdown does not block termination of the process.
164
+
awaitPromise.race([exitPromise,errorPromise]);
165
+
assert.ok(
166
+
appTerminationTook<appTerminationThreshold,
167
+
`The application under test terminated ${appTerminationTook} ms after sending SIGTERM, exceeding the allowed threshold of ${appTerminationThreshold} ms.`
0 commit comments