From e6ae307ddf39a568e7149729481c240bbb73e9ce Mon Sep 17 00:00:00 2001 From: Alexander Vakrilov Date: Wed, 30 Aug 2017 13:30:53 +0300 Subject: [PATCH] Increase timeout for HTTP tests (#4775) --- tests/app/TKUnit.ts | 4 ++-- tests/app/testRunner.ts | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/app/TKUnit.ts b/tests/app/TKUnit.ts index aa06d4302..103c152bc 100644 --- a/tests/app/TKUnit.ts +++ b/tests/app/TKUnit.ts @@ -118,13 +118,13 @@ function runAsync(testInfo: TestInfoEntry, recursiveIndex: number, testTimeout?: testInfo.isPassed = true; runTests(testsQueue, recursiveIndex + 1); } else if (error) { - write(`--- ["${testInfo.testName}"] FAILED: ${error.message}, duration: ${duration}`, trace.messageType.error); + write(`--- [${testInfo.testName}] FAILED: ${error.message}, duration: ${duration}`, trace.messageType.error); testInfo.errorMessage = error.message; runTests(testsQueue, recursiveIndex + 1); } else { const testEndTime = time(); if (testEndTime - testStartTime > timeout) { - write(`--- ["${testInfo.testName}"] TIMEOUT, duration: ${duration}`, trace.messageType.error); + write(`--- [${testInfo.testName}] TIMEOUT, duration: ${duration}`, trace.messageType.error); testInfo.errorMessage = "Test timeout."; runTests(testsQueue, recursiveIndex + 1); } else { diff --git a/tests/app/testRunner.ts b/tests/app/testRunner.ts index f98947464..ed5169e21 100644 --- a/tests/app/testRunner.ts +++ b/tests/app/testRunner.ts @@ -238,6 +238,10 @@ allTests["SEARCH-BAR"] = searchBarTests; import * as navigationTests from "./navigation/navigation-tests"; allTests["NAVIGATION"] = navigationTests; +const testsSuitesWithLongDelay = { + HTTP: 15 * 1000, +} + const testsWithLongDelay = { testLocation: 10000, testLocationOnce: 10000, @@ -433,7 +437,7 @@ export function runAll(testSelector?: string) { if (test.setUp) { testsQueue.push(new TestInfo(test.setUp, test)); } - const testTimeout = testsWithLongDelay[testName]; + const testTimeout = testsWithLongDelay[testName] || testsSuitesWithLongDelay[name]; testsQueue.push(new TestInfo(testFunction, test, true, name + "." + testName, false, null, testTimeout)); if (test.tearDown) { testsQueue.push(new TestInfo(test.tearDown, test));