diff --git a/tools/tests/releases.js b/tools/tests/releases.js index 20a9c5a9eb..fdd1f03567 100644 --- a/tools/tests/releases.js +++ b/tools/tests/releases.js @@ -194,7 +194,7 @@ selftest.define("checkout", ['checkout'], async function () { await s.cd('myapp', async function () { s.write(".meteor/release", "something"); run = s.run("list"); - run.readErr("=> Running Meteor from a checkout"); + await run.readErr("=> Running Meteor from a checkout"); await run.matchErr("project version"); await run.matchErr("(Meteor something)\n"); run.waitSecs(10); diff --git a/tools/tool-testing/matcher.js b/tools/tool-testing/matcher.js index 6523269cd0..4b0e4ef662 100644 --- a/tools/tool-testing/matcher.js +++ b/tools/tool-testing/matcher.js @@ -70,26 +70,13 @@ export default class Matcher { matchFullBuffer = false, }) { if (this.matchPromise) { - // wait a bit to let the matcher catch up - // [FIBERS] - // TODO: check this later - const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); - await sleep(100); - - this._tryMatch(); // could clear this.matchPromise - - // If we still have a matchPromise, then we have a problem. - // you should check who is calling. - if (this.matchPromise) { - return Promise.reject(new Error("already have a match pending?")) - } + return Promise.reject(new Error("already have a match pending?")); } this.matchPattern = pattern; this.matchStrict = strict; this.matchFullBuffer = matchFullBuffer; - this.matchPromise = makeFulfillablePromise(); - const mp = this.matchPromise; - this._tryMatch(); // could clear this.matchPromise + const mp = this.matchPromise = makeFulfillablePromise(); + await this._tryMatch(); // could clear this.matchPromise let timer = null; if (timeout) {