如何追查是什么导致超时?
我正在使用摩卡来运行一些testing。 当我遇到一组特定的testing时:
describe "Results Summaries", -> before (done) -> Testing.use("surveyplanet_test") Testing.initialUsers -> Testing.clearResultData -> done() beforeEach (done) -> Testing.redis.flushdb -> done() describe "Multiple Choice", -> describe "Standard Choice Selection", -> before (done) -> Testing.clearResultData -> Testing.loadQuestion "standardMC", -> Testing.loadExportData data: summarydata.standardMC onComplete: done describe "Pre-Summarization", -> before (done) -> answer_data = {} Testing.getMultipleTables tables: ["answers_main"] onComplete: (data) -> answer_data = data done()
它引发错误:
结果摘要1)“全部”挂钩
340 340次testing中有1次失败:
1)结果摘要“全部”挂钩:错误:2000毫秒超时在对象。 (/usr/local/lib/node_modules/mocha/lib/runnable.js:142:14)在Timer.list.ontimeout(timers.js:101:19)
有什么办法来得到我的代码扔出错误的堆栈跟踪?
我会尝试改变你的记者。 我用
mocha --compilers coffee:coffee-script *.coffee --ui bdd -d --watch -R Nyan
,当我失败的时候,得到大约20行的痕迹。
超时通常意味着(我从来没有见过它),你的done()
没有被打到。 我怀疑这其中的一个:
Testing.initialUsers -> Testing.clearResultData ->
不调用它的callback。