Browse Source

fix(nextcloud): Fix waiting on apache in tests

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/980/head
jld3103 1 year ago
parent
commit
9307bf4769
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 14
      packages/nextcloud/test/helper.dart

14
packages/nextcloud/test/helper.dart

@ -140,11 +140,15 @@ Future<TestNextcloudClient> getTestClient(
try {
await client.core.getStatus();
break;
} on DynamiteApiException catch (error) {
i++;
await Future<void>.delayed(const Duration(milliseconds: 100));
if (i >= 30) {
throw TimeoutException('Failed to get the status of the Server. $error');
} catch (error) {
if (error is HttpException || error is DynamiteApiException) {
i++;
await Future<void>.delayed(const Duration(milliseconds: 100));
if (i >= 300) {
throw TimeoutException('Failed to get the status of the Server. $error');
}
} else {
rethrow;
}
}
}

Loading…
Cancel
Save