Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flake in install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts #1495

Open
petermetz opened this issue Nov 2, 2021 · 0 comments
Labels
API_Server bug Something isn't working dependencies Pull requests that update a dependency file Developer_Experience Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) good-first-issue Good for newcomers good-first-issue-400-expert Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. help wanted Extra attention is needed Nice-to-Have Tests Anything related to tests be that automatic or manual, integration or unit, etc.

Comments

@petermetz
Copy link
Contributor

petermetz commented Nov 2, 2021

Describe the bug

The test fails in the CI environment intermittently:
packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts

To Reproduce

Run the CI enough times to make it fail.

Expected behavior

Test is stable/consistent in it's outcome.

Logs/Stack traces

Complete log archives of the full CI run: logs_10454.zip

Relevant snippet:

# Subtest: packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts
    # can install plugin-ledger-connector-fabric
    Warning: configuration param 'type' not declared in the schema
    [2021-11-02T18:03:33.486Z] INFO (config-service): Configuration validation OK.
    [2021-11-02T18:03:33.503Z] DEBUG (api-server): pluginsPath: '/home/runner/work/cactus/cactus/.tmp/test/cmd-api-server/runtime-plugin-imports_test/43a396a5-f016-4be5-85ef-21ab165e6a69'
    [2021-11-02T18:03:33.504Z] INFO (api-server): Setting tls.DEFAULT_MAX_VERSION to TLSv1.3...
    [2021-11-02T18:03:33.505Z] INFO (api-server): wwwRoot: packages/cactus-cmd-api-server/node_modules/@hyperledger/cactus-cockpit/www/
    [2021-11-02T18:03:33.505Z] INFO (api-server): resolvedWwwRoot: /home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/node_modules/@hyperledger/cactus-cockpit/www
    [2021-11-02T18:03:33.505Z] INFO (api-server): resolvedIndexHtml: /home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/node_modules/@hyperledger/cactus-cockpit/www/index.html
    [2021-11-02T18:03:33.510Z] INFO (api-server): Cactus Cockpit net.AddressInfo { address: '127.0.0.1', family: 'IPv4', port: 42967 }
    [2021-11-02T18:03:33.512Z] INFO (api-server): getOrInitPluginRegistry() initializing a new one...
    [2021-11-02T18:03:33.512Z] INFO (api-server): Instantiated empty registry, invoking plugin factories...
    [2021-11-02T18:03:33.512Z] INFO (api-server): Creating plugin from package: @hyperledger/cactus-plugin-ledger-connector-fabric {
      instanceId: '410cf847-dd52-4b2f-90ff-9c36277ab46e',
      logLevel: 'TRACE',
      connectionProfile: {},
      peerBinary: 'peer'
    }
    [2021-11-02T18:03:33.515Z] DEBUG (api-server): @hyperledger/cactus-plugin-ledger-connector-fabric plugin package dir: '/home/runner/work/cactus/cactus/.tmp/test/cmd-api-server/runtime-plugin-imports_test/43a396a5-f016-4be5-85ef-21ab165e6a69/410cf847-dd52-4b2f-90ff-9c36277ab46e'
    [2021-11-02T18:03:33.515Z] DEBUG (api-server): Installing @hyperledger/cactus-plugin-ledger-connector-fabric for plugin import {
      packageName: '@hyperledger/cactus-plugin-ledger-connector-fabric',
      type: 'org.hyperledger.cactus.plugin_import_type.LOCAL',
      options: {
        instanceId: '410cf847-dd52-4b2f-90ff-9c36277ab46e',
        logLevel: 'TRACE',
        connectionProfile: {},
        peerBinary: 'peer'
      }
    }
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @hyperledger/cactus-common@1.0.0-rc.2.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-11-02T18_04_24_139Z-debug.log
[2021-11-02T18:04:24.182Z] ERROR (api-server): Failed to start ApiServer: RuntimeError: ApiServer#installPluginPackage() plugin install fail: @hyperledger/cactus-plugin-ledger-connector-fabric
    at ApiServer.installPluginPackage (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:14:406)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ApiServer.instantiatePlugin (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2659)
    at async ApiServer.initPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2073)
    at async ApiServer.getOrInitPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:1240)
    at async ApiServer.startApiServer (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:4:21)
    at async ApiServer.start (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:3:5740)
    at async /home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts:63:3
[2021-11-02T18:04:24.182Z] ERROR (api-server): Attempting shutdown...
    [2021-11-02T18:04:24.182Z] INFO (api-server): Shutting down API server ...
    [2021-11-02T18:04:24.183Z] INFO (api-server): getOrInitPluginRegistry() initializing a new one...
    [2021-11-02T18:04:24.183Z] INFO (api-server): Instantiated empty registry, invoking plugin factories...
    [2021-11-02T18:04:24.183Z] INFO (api-server): Creating plugin from package: @hyperledger/cactus-plugin-ledger-connector-fabric {
      instanceId: '410cf847-dd52-4b2f-90ff-9c36277ab46e',
      logLevel: 'TRACE',
      connectionProfile: {},
      peerBinary: 'peer'
    }
    [2021-11-02T18:04:24.186Z] DEBUG (api-server): @hyperledger/cactus-plugin-ledger-connector-fabric plugin package dir: '/home/runner/work/cactus/cactus/.tmp/test/cmd-api-server/runtime-plugin-imports_test/43a396a5-f016-4be5-85ef-21ab165e6a69/410cf847-dd52-4b2f-90ff-9c36277ab46e'
    [2021-11-02T18:04:24.186Z] DEBUG (api-server): Installing @hyperledger/cactus-plugin-ledger-connector-fabric for plugin import {
      packageName: '@hyperledger/cactus-plugin-ledger-connector-fabric',
      type: 'org.hyperledger.cactus.plugin_import_type.LOCAL',
      options: {
        instanceId: '410cf847-dd52-4b2f-90ff-9c36277ab46e',
        logLevel: 'TRACE',
        connectionProfile: {},
        peerBinary: 'peer'
      }
    }
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @hyperledger/cactus-common@1.0.0-rc.2.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-11-02T18_04_26_792Z-debug.log
[2021-11-02T18:04:26.817Z] ERROR (api-server): API server failed to shut itself down, will ignore this because we were already crashing anyway... r [RuntimeError]: ApiServer#installPluginPackage() plugin install fail: @hyperledger/cactus-plugin-ledger-connector-fabric
    at ApiServer.installPluginPackage (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:14:406)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ApiServer.instantiatePlugin (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2659)
    at async ApiServer.initPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2073)
    at async ApiServer.getOrInitPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:1240)
    at async ApiServer.shutdown (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:14:652)
    at async ApiServer.start (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:3:7220)
    at async /home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts:63:3 {
  cause: Error: Command failed with exit code 1: npm install @hyperledger/cactus-plugin-ledger-connector-fabric --production --audit=false --progress=false --fund=false --prefix=/home/runner/work/cactus/cactus/.tmp/test/cmd-api-server/runtime-plugin-imports_test/43a396a5-f016-4be5-85ef-21ab165e6a69/410cf847-dd52-4b2f-90ff-9c36277ab46e
      at makeError (/home/runner/work/cactus/cactus/node_modules/lmify/node_modules/execa/lib/error.js:59:11)
      at handlePromise (/home/runner/work/cactus/cactus/node_modules/lmify/node_modules/execa/index.js:114:26)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)
      at async ApiServer.installPluginPackage (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:13:203)
      at async ApiServer.instantiatePlugin (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2659)
      at async ApiServer.initPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2073)
      at async ApiServer.getOrInitPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:1240)
      at async ApiServer.shutdown (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:14:652)
      at async ApiServer.start (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:3:7220)
      at async /home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts:63:3 {
    shortMessage: 'Command failed with exit code 1: npm install @hyperledger/cactus-plugin-ledger-connector-fabric --production --audit=false --progress=false --fund=false --prefix=/home/runner/work/cactus/cactus/.tmp/test/cmd-api-server/runtime-plugin-imports_test/43a396a5-f016-4be5-85ef-21ab165e6a69/410cf847-dd52-4b2f-90ff-9c36277ab46e',
    command: 'npm install @hyperledger/cactus-plugin-ledger-connector-fabric --production --audit=false --progress=false --fund=false --prefix=/home/runner/work/cactus/cactus/.tmp/test/cmd-api-server/runtime-plugin-imports_test/43a396a5-f016-4be5-85ef-21ab165e6a69/410cf847-dd52-4b2f-90ff-9c36277ab46e',
    exitCode: 1,
    signal: undefined,
    signalDescription: undefined,
    stdout: undefined,
    stderr: undefined,
    failed: true,
    timedOut: false,
    isCanceled: false,
    killed: false
  }
}
    not ok 1 started API server dynamic imports OK
      ---
        operator: throws
        expected: |-
          undefined
        actual: |-
          [Error: Failed to start ApiServer: RuntimeError: ApiServer#installPluginPackage() plugin install fail: @hyperledger/cactus-plugin-ledger-connector-fabric
        at ApiServer.installPluginPackage (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:14:406)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async ApiServer.instantiatePlugin (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2659)
        at async ApiServer.initPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2073)
        at async ApiServer.getOrInitPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:1240)
        at async ApiServer.startApiServer (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:4:21)
        at async ApiServer.start (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:3:5740)
        at async /home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts:63:3]
        at: <anonymous> (/home/runner/work/cactus/cactus/node_modules/tape-promise/index.compiled.js:56:12)
        stack: |-
          Error: Failed to start ApiServer: RuntimeError: ApiServer#installPluginPackage() plugin install fail: @hyperledger/cactus-plugin-ledger-connector-fabric
              at ApiServer.installPluginPackage (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:14:406)
              at processTicksAndRejections (internal/process/task_queues.js:95:5)
              at async ApiServer.instantiatePlugin (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2659)
              at async ApiServer.initPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:2073)
              at async ApiServer.getOrInitPluginRegistry (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:8:1240)
              at async ApiServer.startApiServer (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:4:21)
              at async ApiServer.start (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:3:5740)
              at async /home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts:63:3
              at ApiServer.start (/home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/main/typescript/api-server.ts:3:7435)
              at processTicksAndRejections (internal/process/task_queues.js:95:5)
              at async /home/runner/work/cactus/cactus/packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts:63:3
      ...
    Bail out! started API server dynamic imports OK
Bail out! started API server dynamic imports OK

Screenshots

Nope.

Cloud provider or hardware configuration:

GHA CI runner

Operating system name, version, build:

Ubuntu 20.04

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

rc2

Hyperledger Cactus Plugins/Connectors Used

N/A

@petermetz petermetz added bug Something isn't working good-first-issue Good for newcomers help wanted Extra attention is needed API_Server Nice-to-Have dependencies Pull requests that update a dependency file Developer_Experience Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. good-first-issue-400-expert Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) Tests Anything related to tests be that automatic or manual, integration or unit, etc. labels Nov 2, 2021
outSH added a commit to outSH/cactus that referenced this issue Jul 4, 2022
- Remove flaky tests from main CI execution.
- Add separate TAP and jest configuration for running only flaky tests.
- Add test:*:flaky scripts in the main package.json
- Add new step to github CI script to run flaky tests as optional
  (i.e. don't fail if flaky test fails)

Closes: hyperledger-cacti#2112

Related: hyperledger-cacti#2104
Related: hyperledger-cacti#1626
Related: hyperledger-cacti#2019
Related: hyperledger-cacti#1625
Related: hyperledger-cacti#1543
Related: hyperledger-cacti#1598
Related: hyperledger-cacti#1528
Related: hyperledger-cacti#1521
Related: hyperledger-cacti#1495
Related: hyperledger-cacti#1485
Related: hyperledger-cacti#1473
Related: hyperledger-cacti#1471
Related: hyperledger-cacti#1469
Related: hyperledger-cacti#1150

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API_Server bug Something isn't working dependencies Pull requests that update a dependency file Developer_Experience Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) good-first-issue Good for newcomers good-first-issue-400-expert Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. help wanted Extra attention is needed Nice-to-Have Tests Anything related to tests be that automatic or manual, integration or unit, etc.
Projects
None yet
Development

No branches or pull requests

1 participant