Skip to content

Commit

Permalink
timeout for exchange test now 200s + timeour error shows correctly now
Browse files Browse the repository at this point in the history
  • Loading branch information
xpl committed Sep 24, 2017
1 parent d69648e commit c92e76e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const testExchange = async (exchange) => {

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

function TaskPool ({ maxTime, maxConcurrency }) {
function TaskPool (maxConcurrency) {

const pending = []
, queue = []
Expand All @@ -178,7 +178,7 @@ function TaskPool ({ maxTime, maxConcurrency }) {

} else { // execute task

let p = timeout (maxTime, task ()).then (x => {
let p = task ().then (x => {
numActive--
return (queue.length && (numActive < maxConcurrency))
? queue.shift () ().then (() => x)
Expand All @@ -200,12 +200,12 @@ async function testAllExchanges () {
//
// return Promise.all (exchanges.map (testExchange))

const taskPool = TaskPool ({ maxTime: 120*1000, maxConcurrency })
const taskPool = TaskPool (maxConcurrency)
const results = []

for (const ex of exchanges) {
taskPool.run (() => testExchange (ex)
.catch (e => ({ failed: true, explain () { log.bright.red.error (exchange, e) } }))
for (const exchange of exchanges) {
taskPool.run (() => timeout (200*1000, testExchange (exchange))
.catch (e => ({ exchange, failed: true, explain () { log.bright.red.error (exchange, e) } }))
.then (x => results.push (x)))
}

Expand Down

0 comments on commit c92e76e

Please sign in to comment.