Skip to content

Commit

Permalink
tests: higher timeout for waiting for tests
Browse files Browse the repository at this point in the history
This test is a bit flaky from time to time. Increasing the wait time
should fix this, until we figure out why tap fires the afterEach too
early.
  • Loading branch information
rmehner committed Aug 1, 2017
1 parent e83a89a commit 02b661f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/jobs/create-initial-pr-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const worker = require('../../jobs/create-initial-pr-comment')
const upsert = require('../../lib/upsert')

const dbs = require('../../lib/dbs')
const timeToWaitAfterTests = 500

const waitFor = (milliseconds) => {
return new Promise((resolve) => {
Expand Down Expand Up @@ -111,7 +112,7 @@ test('create-initial-pr-comment', async t => {

const prDoc = await repositories.get('42:pr:1234')
t.ok(prDoc.initialPrCommentSent, 'initialPrCommentSent set to true')
await waitFor(50)
await waitFor(timeToWaitAfterTests)
})

t.test('does nothing if the repo has already received the comment', async t => {
Expand All @@ -134,7 +135,7 @@ test('create-initial-pr-comment', async t => {
const newJob = await runWorker()

t.notOk(newJob, 'no new job')
await waitFor(50)
await waitFor(timeToWaitAfterTests)
})

t.test('does nothing if the issue was closed in the meanwhile', async t => {
Expand All @@ -155,7 +156,7 @@ test('create-initial-pr-comment', async t => {
const newJob = await runWorker()

t.notOk(newJob, 'no new job')
await waitFor(50)
await waitFor(timeToWaitAfterTests)
})

t.test('does nothing if the issue was locked in the meanwhile', async t => {
Expand All @@ -176,6 +177,6 @@ test('create-initial-pr-comment', async t => {
const newJob = await runWorker()

t.notOk(newJob, 'no new job')
await waitFor(50)
await waitFor(timeToWaitAfterTests)
})
})

0 comments on commit 02b661f

Please sign in to comment.