Skip to content

Commit 878dbf0

Browse files
committed
Set global jasmine timeout for stress test
Instead of a per-test timeout. Looks like the per-test timeout is not quite honored by the stress test. It times out after 20 minutes instead of the configured 60 minutes. This commit is a tentative attempt to fix it.
1 parent d57794a commit 878dbf0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/v1/stress.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,22 @@ describe('stress tests', () => {
4646
const DATABASE_URI = fromEnvOrDefault('STRESS_TEST_DATABASE_URI', 'bolt://localhost');
4747
const LOGGING_ENABLED = fromEnvOrDefault('STRESS_TEST_LOGGING_ENABLED', false);
4848

49+
let originalTimeout;
4950
let driver;
5051

5152
beforeEach(done => {
53+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
54+
jasmine.DEFAULT_TIMEOUT_INTERVAL = TEST_MODE.maxRunTimeMs;
55+
5256
const config = {logging: neo4j.logging.console(LOGGING_ENABLED ? 'debug' : 'info')};
5357
driver = neo4j.driver(DATABASE_URI, sharedNeo4j.authToken, config);
5458

5559
cleanupDb(driver).then(() => done());
5660
});
5761

5862
afterEach(done => {
63+
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
64+
5965
cleanupDb(driver).then(() => {
6066
driver.close();
6167
done();
@@ -82,7 +88,7 @@ describe('stress tests', () => {
8288
.then(() => done())
8389
.catch(error => done.fail(error));
8490
});
85-
}, TEST_MODE.maxRunTimeMs);
91+
});
8692

8793
function createCommands(context) {
8894
const uniqueCommands = createUniqueCommands(context);

0 commit comments

Comments
 (0)