Skip to content

Commit

Permalink
removed concurrency limiting from tests, added dmesg|grep -i kill to …
Browse files Browse the repository at this point in the history
…see if any out-of-memory errors happened
  • Loading branch information
xpl committed Sep 25, 2017
1 parent 158e4d4 commit 3941278
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ script:
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then env COMMIT_MESSAGE=${NPM_VERSION:1} GITHUB_TOKEN=${GITHUB_TOKEN} ./push.sh; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then env COMMIT_MESSAGE=${NPM_VERSION:1} GITHUB_TOKEN=${GITHUB_TOKEN} ./push-wiki.sh; fi
after_failure:
- dmesg | grep -i kill
- sleep 4
deploy:
- provider: npm
Expand Down
26 changes: 17 additions & 9 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const keys = {

let exchanges = []
let symbol = 'all'
let maxConcurrency = 10
let maxConcurrency = Number.MAX_VALUE // no limit

for (const arg of args) {
if (arg.startsWith ('--')) { keys[arg] = true }
Expand Down Expand Up @@ -97,6 +97,16 @@ const exec = (bin, ...args) =>

/* ------------------------------------------------------------------------ */

// const execWithRetry = () => {

// // Sometimes execution (on a remote CI server) is just fails with no
// // apparent reason, leaving an empty stdout/stderr behind. I suspect
// // it's related to out-of-memory errors. So in that case we will re-try
// // until it eventually finalizes.
// }

/* ------------------------------------------------------------------------ */

let numExchangesTested = 0

/* Tests of different languages for the same exchange should be run
Expand Down Expand Up @@ -129,9 +139,9 @@ const testExchange = async (exchange) => {
, selectedTests = allTests.filter (t => keys[t.key])
, scheduledTests = selectedTests.length ? selectedTests : allTests
, completeTests = await sequentialMap (scheduledTests, async test => Object.assign (test, await exec (...test.exec)))
, failed = completeTests.find (test => test.failed)
, hasWarnings = completeTests.find (test => test.hasWarnings)
, warnings = completeTests.reduce ((total, { warnings }) => total.concat (warnings), [])
, failed = completeTests.find (test => test.failed)
, hasWarnings = completeTests.find (test => test.hasWarnings)
, warnings = completeTests.reduce ((total, { warnings }) => total.concat (warnings), [])

/* Print interactive log output */

Expand Down Expand Up @@ -203,10 +213,6 @@ function TaskPool (maxConcurrency) {

async function testAllExchanges () {

// NOTE: naive impl crashes with out-of-memory-error eventually (in Travis), so need some pooling...
//
// return Promise.all (exchanges.map (testExchange))

const taskPool = TaskPool (maxConcurrency)
const results = []

Expand All @@ -223,7 +229,9 @@ async function testAllExchanges () {

(async function () {

log.bright.magenta.noPretty ('Testing'.white, { exchanges, symbol, keys, maxConcurrency })
log.bright.magenta.noPretty ('Testing'.white, Object.assign (
{ exchanges, symbol, keys },
maxConcurrency >= Number.MAX_VALUE ? {} : { maxConcurrency }))

const tested = await testAllExchanges ()
, warnings = tested.filter (t => !t.failed && t.hasWarnings)
Expand Down

0 comments on commit 3941278

Please sign in to comment.