From 6dd18b348bb837d59d0c4dd90bf7d32bee381bbf Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sun, 8 Nov 2015 22:48:15 -0700 Subject: [PATCH] Include more debug info when nextViewUpdatePromise times out --- spec/text-editor-component-spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index 4e9d04941..a8ee824ae 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -4725,17 +4725,19 @@ describe('TextEditorComponent', function () { } function nextViewUpdatePromise () { - let timeoutError = new Error("Timed out waiting on a view update") + let timeoutError = new Error('Timed out waiting on a view update.') Error.captureStackTrace(timeoutError, nextViewUpdatePromise) return new Promise(function (resolve, reject) { - atom.views.getNextUpdatePromise().then(function (ts) { + let nextUpdatePromise = atom.views.getNextUpdatePromise() + nextUpdatePromise.then(function (ts) { window.clearTimeout(timeout) resolve(ts) }) let timeout = window.setTimeout(function () { + timeoutError.message += ' Frame pending? ' + atom.views.animationFrameRequest + ' Same next update promise pending? ' + (nextUpdatePromise === atom.views.nextUpdatePromise) reject(timeoutError) - }, 3000) + }, 5000) }) }