Skip to content

Commit 85979f2

Browse files
authored
chore(toolkit-lib): set test timeout to 10s (#618)
Any tests that synth an assembly require a little longer to run. Let's just acknowledge that. Otherwise we keep running into test failures due to timeouts locally. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent fafb1f6 commit 85979f2

File tree

9 files changed

+3
-19
lines changed

9 files changed

+3
-19
lines changed

.projenrc.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,9 @@ const toolkitLib = configureProject(
774774
},
775775
jestOptions: jestOptionsForProject({
776776
jestConfig: {
777+
// Tests that synth an assembly usually need a bit longer
778+
testTimeout: 10_000,
777779
coverageThreshold: {
778-
// this is very sad but we will get better
779780
statements: 87,
780781
branches: 83,
781782
functions: 82,

packages/@aws-cdk/toolkit-lib/jest.config.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/toolkit-lib/test/actions/deploy-hotswap.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { Toolkit } from '../../lib/toolkit';
22
import { builderFixture, TestIoHost } from '../_helpers';
33

4-
jest.setTimeout(10_000);
5-
64
const ioHost = new TestIoHost();
75
const toolkit = new Toolkit({ ioHost });
86

packages/@aws-cdk/toolkit-lib/test/actions/deploy-trace-logs.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { Toolkit } from '../../lib/toolkit';
55
import { TestIoHost, builderFixture } from '../_helpers';
66
import { MockSdk } from '../_helpers/mock-sdk';
77

8-
jest.setTimeout(10_000);
9-
108
let ioHost: TestIoHost;
119
let toolkit: Toolkit;
1210

packages/@aws-cdk/toolkit-lib/test/actions/deploy.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import * as deployments from '../../lib/api/deployments';
44
import { Toolkit } from '../../lib/toolkit';
55
import { builderFixture, cdkOutFixture, disposableCloudAssemblySource, TestIoHost } from '../_helpers';
66

7-
jest.setTimeout(10_000);
8-
97
let ioHost: TestIoHost;
108
let toolkit: Toolkit;
119
let mockDeployStack: jest.SpyInstance<Promise<DeployStackResult>, [DeployStackOptions]>;

packages/@aws-cdk/toolkit-lib/test/actions/diff.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import { Toolkit } from '../../lib/toolkit';
99
import { builderFixture, disposableCloudAssemblySource, TestIoHost } from '../_helpers';
1010
import { MockSdk, restoreSdkMocksToDefault, setDefaultSTSMocks } from '../_helpers/mock-sdk';
1111

12-
// tests using fixtures can sometimes take a bit longer
13-
jest.setTimeout(10_000);
14-
1512
let ioHost: TestIoHost;
1613
let toolkit: Toolkit;
1714

packages/@aws-cdk/toolkit-lib/test/actions/refactor.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import { SdkProvider } from '../../lib/api/aws-auth/private';
44
import { builderFixture, TestIoHost } from '../_helpers';
55
import { mockCloudFormationClient, MockSdk } from '../_helpers/mock-sdk';
66

7-
// these tests often run a bit longer than the default
8-
jest.setTimeout(10_000);
9-
107
const ioHost = new TestIoHost();
118
const toolkit = new Toolkit({ ioHost, unstableFeatures: ['refactor'] });
129

packages/@aws-cdk/toolkit-lib/test/actions/synth.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { Toolkit } from '../../lib/toolkit';
22
import { appFixture, builderFixture, disposableCloudAssemblySource, TestIoHost } from '../_helpers';
33

4-
// these tests often run a bit longer than the default
5-
jest.setTimeout(10_000);
6-
74
const ioHost = new TestIoHost();
85
const toolkit = new Toolkit({ ioHost });
96

packages/@aws-cdk/toolkit-lib/test/api/cloud-assembly/source-builder.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import { Toolkit } from '../../../lib/toolkit/toolkit';
88
import { ToolkitError } from '../../../lib/toolkit/toolkit-error';
99
import { appFixture, appFixtureConfig, autoCleanOutDir, builderFixture, builderFunctionFromFixture, cdkOutFixture, TestIoHost } from '../../_helpers';
1010

11-
// these tests often run a bit longer than the default
12-
jest.setTimeout(10_000);
13-
1411
const ioHost = new TestIoHost();
1512
const toolkit = new Toolkit({ ioHost });
1613

0 commit comments

Comments
 (0)