From 86a8fd98108a63509f2c114a31c9bba1c495f8f0 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 26 Jul 2020 13:54:41 +0200 Subject: [PATCH] Attempt to reduce intermittent failures in the "cleans up document resources during rendering of page" unit-test This patch should *hopefully* remove the `Unhandled promise rejection: ...` errors, by returning the "final" promise. Also, by pausing/delaying of rendering slightly the likelihood of the test failing in the first place should thus be reduced. --- test/unit/api_spec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js index 3a5c77ba9..cb0dcf9fd 100644 --- a/test/unit/api_spec.js +++ b/test/unit/api_spec.js @@ -1906,7 +1906,11 @@ describe("api", function () { viewport, }); - pdfDoc + renderTask.onContinue = function (cont) { + waitSome(cont); + }; + + return pdfDoc .cleanup() .then( () => {