Skip to content

Commit 07eb111

Browse files
committed
fix: travis timeout
1 parent 204c1ed commit 07eb111

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"lint": "xo",
8-
"test": "nyc ava test/scenarios/* --timeout 60000",
8+
"test": "nyc ava test/scenarios/* --timeout 5m",
99
"semantic-release": "semantic-release",
1010
"report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov"
1111
},

test/scenarios/test.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const test = require('ava');
2+
const winston = require('winston');
23
const AWS = require('aws-sdk');
34
const StepFunctionWorker = require('../..');
45
const createActivity = require('../utils/create-activity');
@@ -12,6 +13,11 @@ const activityName = 'test-step-function-worker-' + Math.floor(Math.random() * 1
1213
process.on('uncaughtException', err => {
1314
console.log('uncaughtException', err);
1415
});
16+
const logger = new winston.Logger({
17+
transports: [new winston.transports.Console({
18+
level: 'debug'
19+
})]
20+
});
1521
/*
1622
{
1723
definition: '{"Comment":"An Example State machine using Activity.","StartAt":"FirstState","States":{"FirstState":{"Type":"Task","Resource":"arn:aws:states:eu-central-1:170670752151:activity:test-step-function-worker","TimeoutSeconds":300,"HeartbeatSeconds":60,"Next":"End"}}}',
@@ -51,6 +57,7 @@ test.serial('Step function Activity Worker with 2 consecutive tasks', t => {
5157

5258
const worker = new StepFunctionWorker({
5359
activityArn,
60+
logger,
5461
workerName: workerName + '-fn',
5562
fn
5663
});
@@ -98,6 +105,7 @@ test.serial('Step function with 3 poolConcurrency worker', t => {
98105

99106
const worker = new StepFunctionWorker({
100107
activityArn,
108+
logger,
101109
workerName: workerName + '-poolConcurrency',
102110
fn: fn2,
103111
poolConcurrency: 3
@@ -174,6 +182,7 @@ test.serial('Step function with deprecated concurrency worker', t => {
174182

175183
const worker = new StepFunctionWorker({
176184
activityArn,
185+
logger,
177186
workerName: workerName + '-concurrency',
178187
fn: fn2,
179188
concurrency: 3
@@ -249,6 +258,7 @@ test.serial('Restart the worker', t => {
249258

250259
const worker = new StepFunctionWorker({
251260
activityArn,
261+
logger,
252262
workerName: workerName + '-restart',
253263
fn: fn2,
254264
poolConcurrency: 1
@@ -272,9 +282,9 @@ test.serial('Restart the worker', t => {
272282

273283
if (countSuccess === 1) {
274284
const beforeRestartLength = worker._poolers.length;
275-
console.log('restart');
285+
logger.debug('restart');
276286
worker.restart(() => {
277-
console.log('restarted');
287+
logger.debug('restarted');
278288
t.is(worker._poolers.length, beforeRestartLength);
279289
stepFunction.startExecution(params2).promise();
280290
});

0 commit comments

Comments
 (0)