We could use the amount of time it took to load the page (either with Navigation Timing, or ready/load events) and multiply it by a magic number.
It probably already does. mw.Api has a 30 second timeout by default on everything.
@matmarex, yep, you're right! I'd been waiting for the wrong promise to fail.