gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 03/03: harness: allow running tests without timeout


From: gnunet
Subject: [taler-wallet-core] 03/03: harness: allow running tests without timeout
Date: Fri, 10 Feb 2023 00:07:58 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

commit 1a3040d872769fc65b1a194459f8af40c8077f49
Author: Florian Dold <florian@dold.me>
AuthorDate: Fri Feb 10 00:02:27 2023 +0100

    harness: allow running tests without timeout
---
 packages/taler-harness/src/index.ts                       | 4 ++++
 packages/taler-harness/src/integrationtests/testrunner.ts | 9 +++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/packages/taler-harness/src/index.ts 
b/packages/taler-harness/src/index.ts
index a6decc4ab..e4ee25dae 100644
--- a/packages/taler-harness/src/index.ts
+++ b/packages/taler-harness/src/index.ts
@@ -271,6 +271,9 @@ testingCli
   .flag("quiet", ["--quiet"], {
     help: "Produce less output.",
   })
+  .flag("noTimeout", ["--no-timeout"], {
+    help: "Do not time out tests."
+  })
   .action(async (args) => {
     await runTests({
       includePattern: args.runIntegrationtests.pattern,
@@ -278,6 +281,7 @@ testingCli
       dryRun: args.runIntegrationtests.dryRun,
       verbosity: args.runIntegrationtests.quiet ? 0 : 1,
       includeExperimental: args.runIntegrationtests.experimental ?? false,
+      noTimeout: args.runIntegrationtests.noTimeout,
     });
   });
 
diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts 
b/packages/taler-harness/src/integrationtests/testrunner.ts
index 70008e386..4bad3dac2 100644
--- a/packages/taler-harness/src/integrationtests/testrunner.ts
+++ b/packages/taler-harness/src/integrationtests/testrunner.ts
@@ -198,6 +198,7 @@ export interface TestRunSpec {
   suiteSpec?: string;
   dryRun?: boolean;
   includeExperimental: boolean;
+  noTimeout: boolean;
   verbosity: number;
 }
 
@@ -331,9 +332,13 @@ export async function runTests(spec: TestRunSpec) {
     const defaultTimeout = 60000;
     const testTimeoutMs = testCase.timeoutMs ?? defaultTimeout;
 
-    console.log(`running ${testName} with timeout ${testTimeoutMs}ms`);
+    if (spec.noTimeout) {
+      console.log(`running ${testName}, no timeout`);
+    } else {
+      console.log(`running ${testName} with timeout ${testTimeoutMs}ms`);
+    }
 
-    const { token } = CancellationToken.timeout(testTimeoutMs);
+    const token = spec.noTimeout ? CancellationToken.CONTINUE : 
CancellationToken.timeout(testTimeoutMs).token;
 
     const resultPromise: Promise<TestRunResult> = new Promise(
       (resolve, reject) => {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]