Skip to content

Commit 4e5f58e

Browse files
committed
fix timeout for e2e tests
1 parent 3908dbb commit 4e5f58e

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

packages/b2c-cli/test/functional/e2e/sandbox-lifecycle.test.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77
import {expect} from 'chai';
88
import path from 'node:path';
99
import {fileURLToPath} from 'node:url';
10-
import {getHostname, getSandboxId, parseJSONOutput, runCLI, runCLIWithRetry, TIMEOUTS, toString} from './test-utils.js';
10+
import {
11+
getErrorDetails,
12+
getHostname,
13+
getSandboxId,
14+
parseJSONOutput,
15+
runCLI,
16+
runCLIWithRetry,
17+
TIMEOUTS,
18+
toString,
19+
} from './test-utils.js';
1120

1221
const __filename = fileURLToPath(import.meta.url);
1322
const __dirname = path.dirname(__filename);
@@ -474,9 +483,15 @@ describe('Sandbox Lifecycle E2E Tests', function () {
474483
});
475484

476485
it('should fetch realm usage in JSON format', async function () {
477-
const result = await runCLIWithRetry(['sandbox', 'realm', 'usage', realmId!, '--json'], {verbose: true});
486+
// Realm usage can take >30s against the unified API; use a higher timeout
487+
// than TIMEOUTS.DEFAULT to avoid execa killing the process mid-flight.
488+
this.timeout(180_000);
489+
const result = await runCLIWithRetry(['sandbox', 'realm', 'usage', realmId!, '--json'], {
490+
timeout: 120_000,
491+
verbose: true,
492+
});
478493

479-
expect(result.exitCode, `Realm usage failed: ${toString(result.stderr)}`).to.equal(0);
494+
expect(result.exitCode, `Realm usage failed:\n${getErrorDetails(result)}`).to.equal(0);
480495

481496
const response = parseJSONOutput(result);
482497
expect(response, 'Realm usage response should be a valid object').to.be.an('object');

0 commit comments

Comments
 (0)