I am using flutter test drive to test my flutter app.
All works fine, except after I wait for an element for a long time.
For example I have a login process, which takes a long time (up to 60 seconds, if the test server is busy). So I press the login button and wait for the main page to appear:
await driver.tap(find.byValueKey("login_button"));
await driver.waitUntilNoTransientCallbacks();
await driver.waitFor(find.byValueKey("main_page"), timpout: Duration(seconds: 60));
If I do this, I get: Bad state: The client closed with pending request "ext.flutter.driver".
on the next command I try to execute.
If I mock the login process so that it only takes a fraction of a second, I do not get this error.
How can I tell flutter drive to be a little bit more patient with timing out?