Environment
MacOS 13.0.1
Node 16.16.0
Typescript 4.9.4
Concurrently 7.6.0
Describe the bug
We are attempting to write some integration tests for our azure functions, however the function runtime restarts instead of exiting when the test are complete, so the process never finishes.
To Reproduce
Steps to reproduce the behavior:
- Create a new function app
- Create at least one http trigger
- Write an integration test using
jest which makes a http request against the trigger
- Install the following packages: jest, ts-jest, concurrently, wait-on
- Add the following scripts to
package.json
"pretest": "tsc -p tsconfig.test.json",
"test": "concurrently -k -s last \"func start\" \"wait-on tcp:7071 && jest\"",
- Execute the following command on the terminal:
npm run test
- Wait for process to complete.
Expected behavior
When the jest exits, concurrently should kill the azure function runtime, and terminate.
Actual behavior
- Jest exits successfully.
- Concurrently sends a kill signal to the azure function runtime.
- The azure function runtime restarts itself and keeps running.
- Integration tests never complete, because runtime is still active.
Relevant Console Output
[1] Ran all test suites.
[1] wait-on tcp:7071 && jest exited with code 0
--> Sending SIGTERM to other processes..
[0] [2022-12-08T16:06:34.042Z] Language Worker Process exited. Pid=64056.
[0] [2022-12-08T16:06:34.042Z] node exited with code 143 (0x8F). .
[0] [2022-12-08T16:06:34.280Z] Worker process started and initialized.
Proposed Fix
Add a command line argument to concurrently which will send a SIGKILL signal instead of a SIGTERM signal, to force the azure runtime to exit immediately.
Environment
MacOS 13.0.1
Node 16.16.0
Typescript 4.9.4
Concurrently 7.6.0
Describe the bug
We are attempting to write some integration tests for our azure functions, however the function runtime restarts instead of exiting when the test are complete, so the process never finishes.
To Reproduce
Steps to reproduce the behavior:
jestwhich makes a http request against the triggerpackage.jsonnpm run testExpected behavior
When the jest exits, concurrently should kill the azure function runtime, and terminate.
Actual behavior
Relevant Console Output
Proposed Fix
Add a command line argument to
concurrentlywhich will send a SIGKILL signal instead of a SIGTERM signal, to force the azure runtime to exit immediately.