From f9c37289a821a71734d083eee064739d29aa43a2 Mon Sep 17 00:00:00 2001 From: Mike the Tike Date: Mon, 13 Sep 2021 10:32:06 +0200 Subject: [PATCH] ci: rerun flaky tests --- .circleci/config.yml | 2 +- integration_tests/helpers/baseNodeProcess.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 151c81d979..34234796b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,7 +126,7 @@ commands: - run: name: Run cucumber scenarios no_output_timeout: 20m - command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --tags "not @long-running and not @broken and not @wallet-ffi" --format json:cucumber_output/tests.cucumber --exit --retry 2 --retryTagFilter "@flaky" --parallel 3 + command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --tags "not @long-running and not @broken and not @wallet-ffi" --format json:cucumber_output/tests.cucumber --exit --retry 2 --retryTagFilter "@flaky" - run: name: Generate report command: cd integration_tests && node ./generate_report.js diff --git a/integration_tests/helpers/baseNodeProcess.js b/integration_tests/helpers/baseNodeProcess.js index 179225f48b..736f4a9c06 100644 --- a/integration_tests/helpers/baseNodeProcess.js +++ b/integration_tests/helpers/baseNodeProcess.js @@ -3,7 +3,7 @@ const { expect } = require("chai"); const fs = require("fs"); const path = require("path"); const BaseNodeClient = require("./baseNodeClient"); -const { sleep, getFreePort } = require("./util"); +const { getFreePort } = require("./util"); const dateFormat = require("dateformat"); const { createEnv } = require("./config"); @@ -28,15 +28,18 @@ class BaseNodeProcess { this.name = `Basenode${this.port}-${this.name}`; this.nodeFile = this.nodeFile || "nodeid.json"; + let instance = 0; do { this.baseDir = `${this.options.baseDir}/${dateFormat( new Date(), "yyyymmddHHMM" - )}/${this.name}`; + )}/${instance}/${this.name}`; // Some tests failed during testing because the next base node process started in the previous process // directory therefore using the previous blockchain database if (fs.existsSync(this.baseDir)) { - sleep(1000); + instance++; + } else { + fs.mkdirSync(this.baseDir); } } while (fs.existsSync(this.baseDir)); const args = ["--base-path", ".", "--init", "--create-id"];