Fix tests on systems with a non-master git defaultBranch #1

Open
zebreus wants to merge 140 commits from fix-tests-without-master into main
2 changed files with 8 additions and 5 deletions
Showing only changes of commit d31310bf59 - Show all commits

View file

@ -328,7 +328,7 @@ std::vector<GoalPtr> Worker::run(std::function<Targets (GoalFactory &)> req)
/* Wait for input. */
if (!children.isEmpty())
waitForInput();
waitForInput().wait(aio.waitScope).value();
else {
assert(!awake.empty());
}
@ -351,8 +351,8 @@ std::vector<GoalPtr> Worker::run(std::function<Targets (GoalFactory &)> req)
return results;
}
void Worker::waitForInput()
{
kj::Promise<Result<void>> Worker::waitForInput()
try {
printMsg(lvlVomit, "waiting for children");
auto waitFor = [&]{
@ -366,7 +366,10 @@ void Worker::waitForInput()
waitFor = waitFor.exclusiveJoin(aio.provider->getTimer().afterDelay(10 * kj::SECONDS));
}
waitFor.wait(aio.waitScope);
co_await waitFor;
co_return result::success();
} catch (...) {
co_return result::failure(std::current_exception());
}

View file

@ -156,7 +156,7 @@ private:
/**
* Wait for input to become available.
*/
void waitForInput();
kj::Promise<Result<void>> waitForInput();
/**
* Remove a dead goal.