- fix test: checkout

This commit is contained in:
denihs
2023-04-04 14:02:30 -04:00
parent a32cdab2ca
commit cdaf2e4552
2 changed files with 4 additions and 17 deletions

View File

@@ -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);

View File

@@ -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) {