mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Improve travis success rate
https://travis-ci.org/codecombat/codecombat/builds/96076589 Failures: 1) Recalculate Achievements remove earned achievements Message: Expected 1 to be 0. Stack: Error: Expected 1 to be 0. ... Apparently EarnedAchievement creation from previous tests bleeds into this test case. Adding a timeout to minimize the race condition problem here.
This commit is contained in:
parent
079109145f
commit
def3e9a009
1 changed files with 10 additions and 8 deletions
|
@ -220,6 +220,7 @@ describe 'Recalculate Achievements', ->
|
|||
EarnedAchievementHandler = require '../../../server/achievements/earned_achievement_handler'
|
||||
|
||||
it 'remove earned achievements', (done) ->
|
||||
f = ->
|
||||
clearModels [EarnedAchievement], (err) ->
|
||||
expect(err).toBeNull()
|
||||
EarnedAchievement.find {}, (err, earned) ->
|
||||
|
@ -228,6 +229,7 @@ describe 'Recalculate Achievements', ->
|
|||
User.update {}, {$set: {points: 0}}, {multi:true}, (err) ->
|
||||
expect(err).toBeNull()
|
||||
done()
|
||||
setTimeout f, 100 # wait for previous tests to wrap up to avoid race condition
|
||||
|
||||
it 'can not be accessed by regular users', (done) ->
|
||||
loginJoe -> request.post {uri:getURL '/admin/earned_achievement/recalculate'}, (err, res, body) ->
|
||||
|
|
Loading…
Reference in a new issue