mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Fix task runner's task timeout and heartbeat interval (#14889)
This commit is contained in:
@@ -120,6 +120,36 @@ describe('TaskRunnerProcess', () => {
|
||||
expect(options.env).not.toHaveProperty('NODE_OPTIONS');
|
||||
});
|
||||
|
||||
it('should pass N8N_RUNNERS_TASK_TIMEOUT if set', async () => {
|
||||
jest.spyOn(authService, 'createGrantToken').mockResolvedValue('grantToken');
|
||||
runnerConfig.taskTimeout = 123;
|
||||
|
||||
await taskRunnerProcess.start();
|
||||
|
||||
// @ts-expect-error The type is not correct
|
||||
const options = spawnMock.mock.calls[0][2] as SpawnOptions;
|
||||
expect(options.env).toEqual(
|
||||
expect.objectContaining({
|
||||
N8N_RUNNERS_TASK_TIMEOUT: '123',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should pass N8N_RUNNERS_HEARTBEAT_INTERVAL if set', async () => {
|
||||
jest.spyOn(authService, 'createGrantToken').mockResolvedValue('grantToken');
|
||||
runnerConfig.heartbeatInterval = 456;
|
||||
|
||||
await taskRunnerProcess.start();
|
||||
|
||||
// @ts-expect-error The type is not correct
|
||||
const options = spawnMock.mock.calls[0][2] as SpawnOptions;
|
||||
expect(options.env).toEqual(
|
||||
expect.objectContaining({
|
||||
N8N_RUNNERS_HEARTBEAT_INTERVAL: '456',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should use --disallow-code-generation-from-strings and --disable-proto=delete flags', async () => {
|
||||
jest.spyOn(authService, 'createGrantToken').mockResolvedValue('grantToken');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user