File tree Expand file tree Collapse file tree 3 files changed +24
-14
lines changed
flutter/example/integration_test Expand file tree Collapse file tree 3 files changed +24
-14
lines changed Original file line number Diff line number Diff line change 1- * @ marandaneto @ krystofwoldrich @ stefanosiano
1+ * @ krystofwoldrich @ stefanosiano @ buenaflor
Original file line number Diff line number Diff line change 11name : flutter integration tests
22on :
3- push :
4- branches :
5- - main
6- - release/**
7- pull_request :
8- paths-ignore :
9- - ' file/**'
3+ # Currently broken, enable after fixing
4+ workflow_dispatch
5+ # push:
6+ # branches:
7+ # - main
8+ # - release/**
9+ # pull_request:
10+ # paths-ignore:
11+ # - 'file/**'
1012
1113jobs :
1214 cancel-previous-workflow :
@@ -26,15 +28,15 @@ jobs:
2628 strategy :
2729 fail-fast : false
2830 matrix :
29- sdk : [' stable', ' beta' ]
31+ sdk : [" stable", " beta" ]
3032 steps :
3133 - name : checkout
3234 uses : actions/checkout@v3
3335
3436 - uses : actions/setup-java@v3
3537 with :
36- distribution : ' adopt'
37- java-version : ' 11 '
38+ distribution : " adopt"
39+ java-version : " 11 "
3840
3941 -
uses :
subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # [email protected] 4042 with :
9395 fail-fast : false
9496 matrix :
9597 # 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
96- sdk : [' stable' ]
98+ sdk : [" stable" ]
9799 steps :
98100 - name : checkout
99101 uses : actions/checkout@v3
Original file line number Diff line number Diff line change 1+ // ignore_for_file: avoid_print
2+
13import 'dart:async' ;
24import 'dart:convert' ;
35
@@ -160,6 +162,7 @@ void main() {
160162 final uri = Uri .parse (
161163 'https://sentry.io/api/0/projects/$org /$slug /events/$id /' ,
162164 );
165+ expect (authToken, isNotEmpty);
163166
164167 final event = await fixture.poll (uri, authToken);
165168 expect (event, isNotNull);
@@ -206,26 +209,31 @@ class Fixture {
206209
207210 const maxRetries = 10 ;
208211 const initialDelay = Duration (seconds: 2 );
209- const factor = 2 ;
212+ const delayIncrease = Duration (seconds : 2 ) ;
210213
211214 var retries = 0 ;
212215 var delay = initialDelay;
213216
214217 while (retries < maxRetries) {
215218 try {
219+ print ("Trying to fetch $url [try $retries /$maxRetries ]" );
216220 final response = await client.get (
217221 url,
218222 headers: < String , String > {'Authorization' : 'Bearer $authToken ' },
219223 );
224+ print ("Response status code: ${response .statusCode }" );
220225 if (response.statusCode == 200 ) {
221226 return jsonDecode (utf8.decode (response.bodyBytes));
227+ } else if (response.statusCode == 401 ) {
228+ print ("Cannot fetch $url - invalid auth token." );
229+ break ;
222230 }
223231 } catch (e) {
224232 // Do nothing
225233 } finally {
226234 retries++ ;
227235 await Future .delayed (delay);
228- delay *= factor ;
236+ delay += delayIncrease ;
229237 }
230238 }
231239 return null ;
You can’t perform that action at this time.
0 commit comments