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

Intermittent Travis CI Issues #36

Closed
jonathan-m-hamilton opened this issue Nov 13, 2019 · 7 comments
Closed

Intermittent Travis CI Issues #36

jonathan-m-hamilton opened this issue Nov 13, 2019 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jonathan-m-hamilton
Copy link
Contributor

Investigate flaky Travis CI failures and determine if one or more fixes required

@jonathan-m-hamilton jonathan-m-hamilton added the bug Something isn't working label Nov 13, 2019
@jonathan-m-hamilton jonathan-m-hamilton added this to the v0.2.0 milestone Nov 13, 2019
@jonathan-m-hamilton
Copy link
Contributor Author

Example 1
> @hyperledger/blockchain-integration-framework@0.1.0 test /home/travis/build/hyperledger-labs/blockchain-integration-framework 403> cross-env NODE_ENV=test ./node_modules/.bin/mocha --ui bdd --reporter spec --colors tests/*.js --recursive --exit 404 405/home/travis/build/hyperledger-labs/blockchain-integration-framework/node_modules/mocha/node_modules/yargs/yargs.js:1163 406 else throw err 407 ^ 408 409Error: Cannot find module 'typedarray-to-buffer' 410 at Function.Module._resolveFilename (module.js:548:15) 411 at Function.Module._load (module.js:475:25) 412 at Module.require (module.js:597:17) 413 at require (internal/module.js:11:18) 414 at Object.<anonymous> (/home/travis/build/hyperledger-labs/blockchain-integration-framework/node_modules/web3-providers-ws/node_modules/websocket/lib/W3CWebSocket.js:18:16) 415 at Module._compile (module.js:653:30) 416 at Object.Module._extensions..js (module.js:664:10) 417 at Module.load (module.js:566:32)

@jonathan-m-hamilton
Copy link
Contributor Author

@jonathan-m-hamilton
Copy link
Contributor Author

Hopefully not as flaky as thought 😎

/home/travis/build/hyperledger-labs/blockchain-integration-framework/node_modules/mocha/node_modules/yargs/yargs.js:1163 400 else throw err 401 ^ 402 403Error: Cannot find module 'typedarray-to-buffer'

@petermetz
Copy link
Member

petermetz commented Nov 15, 2019

Clue: npm install and npm test both succeed on local ubuntu VM, but the missing dependency is highlighted as an issue there as well.

Some code in a dependency might be importing different packages at runtime based on some criteria that differentiates between the Travis CI VM and the local VM I'm testing with:

$ npm ls typedarray-to-buffer
@hyperledger-labs/blockchain-integration-framework@0.1.0 /REDACTED/blockchain-integration-framework
└─┬ web3@1.0.0-beta.37
  └─┬ web3-core@1.0.0-beta.37
    └─┬ web3-core-requestmanager@1.0.0-beta.37
      └─┬ web3-providers-ws@1.0.0-beta.37
        └─┬ websocket@1.0.26 invalid (git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2)
          └── UNMET DEPENDENCY typedarray-to-buffer@^3.1.2

npm ERR! invalid: websocket@1.0.26 /REDACTED/blockchain-integration-framework/node_modules/web3-providers-ws/node_modules/websocket
npm ERR! missing: typedarray-to-buffer@^3.1.2, required by websocket@1.0.26

@petermetz
Copy link
Member

Tried upgrading web3 to latest stable but that has another issue that breaks dependencies (v1.2.3)
web3/web3.js#3210

Will try with web3 1.2.2

@petermetz
Copy link
Member

I tinkered with the travis build, had to update the web3 version from that beta release to a stable one and put in some shell code to ensure npm dependencies are installed in the example sub-projects as well (fabric/api, quorum/api)

There is still the issue of flakiness which is a different one, it appears to be in one of the unit tests, but that doesn't always fail, just sometimes.

For now I put the fixed up code here in a draft PR, will hopefully come up with something for the flaky unit test tomorrow:
#50

@petermetz
Copy link
Member

Web3 released a fix for the dependency issues in v1.2.3 this morning, going to use that:
https://github.com/ethereum/web3.js/releases

petermetz added a commit that referenced this issue Nov 18, 2019
Also a list of other changes that were required to make the CI green:
- clean up steps in the script: remove .git folder of websocket package
- install npm dependencies in the fabric and quorum api folders
- update web3 to 1.2.4
- update the post install patching of web3 formatter to match v1.2.4
- clean up: run "down" npm script for fabric and quorum
- force volume re-creation when calling docker-compose up

Also: the CI script is now in a separate .sh file so that it can
be invoked locally on any dev machine that has the dependencies pre-installed

Fixes #12
Fixes #36

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
blefevre pushed a commit to blefevre/blockchain-integration-framework that referenced this issue Feb 4, 2020
Also a list of other changes that were required to make the CI green:
- clean up steps in the script: remove .git folder of websocket package
- install npm dependencies in the fabric and quorum api folders
- update web3 to 1.2.4
- update the post install patching of web3 formatter to match v1.2.4
- clean up: run "down" npm script for fabric and quorum
- force volume re-creation when calling docker-compose up

Also: the CI script is now in a separate .sh file so that it can
be invoked locally on any dev machine that has the dependencies pre-installed

Fixes hyperledger#12
Fixes hyperledger#36

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants