mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Increase timeout for HTTP tests (#4775)
This commit is contained in:
committed by
SvetoslavTsenov
parent
7dc6e30d33
commit
e6ae307ddf
@@ -118,13 +118,13 @@ function runAsync(testInfo: TestInfoEntry, recursiveIndex: number, testTimeout?:
|
|||||||
testInfo.isPassed = true;
|
testInfo.isPassed = true;
|
||||||
runTests(testsQueue, recursiveIndex + 1);
|
runTests(testsQueue, recursiveIndex + 1);
|
||||||
} else if (error) {
|
} 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;
|
testInfo.errorMessage = error.message;
|
||||||
runTests(testsQueue, recursiveIndex + 1);
|
runTests(testsQueue, recursiveIndex + 1);
|
||||||
} else {
|
} else {
|
||||||
const testEndTime = time();
|
const testEndTime = time();
|
||||||
if (testEndTime - testStartTime > timeout) {
|
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.";
|
testInfo.errorMessage = "Test timeout.";
|
||||||
runTests(testsQueue, recursiveIndex + 1);
|
runTests(testsQueue, recursiveIndex + 1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -238,6 +238,10 @@ allTests["SEARCH-BAR"] = searchBarTests;
|
|||||||
import * as navigationTests from "./navigation/navigation-tests";
|
import * as navigationTests from "./navigation/navigation-tests";
|
||||||
allTests["NAVIGATION"] = navigationTests;
|
allTests["NAVIGATION"] = navigationTests;
|
||||||
|
|
||||||
|
const testsSuitesWithLongDelay = {
|
||||||
|
HTTP: 15 * 1000,
|
||||||
|
}
|
||||||
|
|
||||||
const testsWithLongDelay = {
|
const testsWithLongDelay = {
|
||||||
testLocation: 10000,
|
testLocation: 10000,
|
||||||
testLocationOnce: 10000,
|
testLocationOnce: 10000,
|
||||||
@@ -433,7 +437,7 @@ export function runAll(testSelector?: string) {
|
|||||||
if (test.setUp) {
|
if (test.setUp) {
|
||||||
testsQueue.push(new TestInfo(test.setUp, test));
|
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));
|
testsQueue.push(new TestInfo(testFunction, test, true, name + "." + testName, false, null, testTimeout));
|
||||||
if (test.tearDown) {
|
if (test.tearDown) {
|
||||||
testsQueue.push(new TestInfo(test.tearDown, test));
|
testsQueue.push(new TestInfo(test.tearDown, test));
|
||||||
|
|||||||
Reference in New Issue
Block a user