Skip to content

Commit

Permalink
Merge branch 'main' into chore/format-and-analyze-check-only
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Aug 29, 2023
2 parents 149a2e9 + 584e03b commit 8ac5c4d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @marandaneto @krystofwoldrich @stefanosiano
* @krystofwoldrich @stefanosiano @buenaflor
24 changes: 13 additions & 11 deletions .github/workflows/flutter_integration_test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: flutter integration tests
on:
push:
branches:
- main
- release/**
pull_request:
paths-ignore:
- 'file/**'
# Currently broken, enable after fixing
workflow_dispatch
# push:
# branches:
# - main
# - release/**
# pull_request:
# paths-ignore:
# - 'file/**'

jobs:
cancel-previous-workflow:
Expand All @@ -26,15 +28,15 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: ['stable', 'beta']
sdk: ["stable", "beta"]
steps:
- name: checkout
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
distribution: "adopt"
java-version: "11"

- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # [email protected]
with:
Expand Down Expand Up @@ -93,7 +95,7 @@ jobs:
fail-fast: false
matrix:
# 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
sdk: ['stable']
sdk: ["stable"]
steps:
- name: checkout
uses: actions/checkout@v3
Expand Down
12 changes: 10 additions & 2 deletions flutter/example/integration_test/integration_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: avoid_print

import 'dart:async';
import 'dart:convert';

Expand Down Expand Up @@ -160,6 +162,7 @@ void main() {
final uri = Uri.parse(
'https://sentry.io/api/0/projects/$org/$slug/events/$id/',
);
expect(authToken, isNotEmpty);

final event = await fixture.poll(uri, authToken);
expect(event, isNotNull);
Expand Down Expand Up @@ -206,26 +209,31 @@ class Fixture {

const maxRetries = 10;
const initialDelay = Duration(seconds: 2);
const factor = 2;
const delayIncrease = Duration(seconds: 2);

var retries = 0;
var delay = initialDelay;

while (retries < maxRetries) {
try {
print("Trying to fetch $url [try $retries/$maxRetries]");
final response = await client.get(
url,
headers: <String, String>{'Authorization': 'Bearer $authToken'},
);
print("Response status code: ${response.statusCode}");
if (response.statusCode == 200) {
return jsonDecode(utf8.decode(response.bodyBytes));
} else if (response.statusCode == 401) {
print("Cannot fetch $url - invalid auth token.");
break;
}
} catch (e) {
// Do nothing
} finally {
retries++;
await Future.delayed(delay);
delay *= factor;
delay += delayIncrease;
}
}
return null;
Expand Down

0 comments on commit 8ac5c4d

Please sign in to comment.