From 45e06ec9d4f38e95971cf9b60b2c5f5bae0d3870 Mon Sep 17 00:00:00 2001 From: Blazebrain Date: Fri, 25 Sep 2026 17:20:44 +0100 Subject: [PATCH 1/5] fix: flaky integration test runs on the CI emulator --- .github/workflows/integration_tests.yml | 2 +- .github/workflows/reusable-integration-test.yml | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index a310bb13a..da1cf5ed3 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -21,7 +21,7 @@ jobs: if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false uses: ./.github/workflows/reusable-integration-test.yml with: - ref: ${{ github.event.pull_request.head.sha || github.sha }} + ref: ${{ github.sha }} suite_dir: integration_test/suites test_tier: tier0 slack_notify: true diff --git a/.github/workflows/reusable-integration-test.yml b/.github/workflows/reusable-integration-test.yml index bd8bafd30..32a65632a 100644 --- a/.github/workflows/reusable-integration-test.yml +++ b/.github/workflows/reusable-integration-test.yml @@ -288,7 +288,8 @@ jobs: SUITE_DIR_INPUT: ${{ inputs.suite_dir }} EXTRA_DART_DEFINES_INPUT: ${{ inputs.extra_dart_defines }} with: - api-level: 29 + api-level: 31 + target: google_apis arch: x86_64 profile: pixel_5 force-avd-creation: false @@ -320,7 +321,8 @@ jobs: SUITE_DIR_INPUT: ${{ inputs.suite_dir }} EXTRA_DART_DEFINES_INPUT: ${{ inputs.extra_dart_defines }} with: - api-level: 29 + api-level: 31 + target: google_apis arch: x86_64 profile: pixel_5 force-avd-creation: false @@ -590,9 +592,3 @@ jobs: -H "Content-type: application/json; charset=utf-8" \ --data "$(jq -n --arg channel "$SLACK_CHANNEL" --arg ts "$thread_ts" --arg text "$passed" \ '{channel: $channel, thread_ts: $ts, text: $text}')" > /dev/null - - - name: Post-test cleanup - if: always() - run: | - pkill -f emulator || echo "No emulator processes to kill" - pkill -f adb || echo "No adb processes to kill" From 3a31bbacab57a08c6b5619a030c1a3ce5ba0718e Mon Sep 17 00:00:00 2001 From: Blazebrain Date: Fri, 25 Sep 2026 18:49:11 +0100 Subject: [PATCH 2/5] fix: skip integration tests on branches without the test suites --- .github/workflows/integration_tests.yml | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index da1cf5ed3..0b964a906 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -17,11 +17,33 @@ concurrency: cancel-in-progress: true jobs: - android-integration-tests: + check-suites: if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false + runs-on: ubuntu-latest + outputs: + present: ${{ steps.suites.outputs.present }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + sparse-checkout: integration_test/suites + + - name: Check the branch has the test suites + id: suites + run: | + if [[ -d integration_test/suites/tier0 ]]; then + echo "present=true" >> "$GITHUB_OUTPUT" + else + echo "present=false" >> "$GITHUB_OUTPUT" + echo "::notice::This branch has no integration test suites yet, sync it with dev to run them" + fi + + android-integration-tests: + needs: check-suites + if: needs.check-suites.outputs.present == 'true' uses: ./.github/workflows/reusable-integration-test.yml with: - ref: ${{ github.sha }} + ref: ${{ github.event.pull_request.head.sha || github.sha }} suite_dir: integration_test/suites test_tier: tier0 slack_notify: true From 63d67da5f7058da0b290d7fbe6f53bd510f2ae6d Mon Sep 17 00:00:00 2001 From: Blazebrain Date: Fri, 25 Sep 2026 18:55:42 +0100 Subject: [PATCH 3/5] fix: fail the integration tests check on branches without the test suites --- .github/workflows/integration_tests.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 0b964a906..1306f81ed 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -20,8 +20,6 @@ jobs: check-suites: if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false runs-on: ubuntu-latest - outputs: - present: ${{ steps.suites.outputs.present }} steps: - uses: actions/checkout@v4 with: @@ -29,18 +27,14 @@ jobs: sparse-checkout: integration_test/suites - name: Check the branch has the test suites - id: suites run: | - if [[ -d integration_test/suites/tier0 ]]; then - echo "present=true" >> "$GITHUB_OUTPUT" - else - echo "present=false" >> "$GITHUB_OUTPUT" - echo "::notice::This branch has no integration test suites yet, sync it with dev to run them" + if [[ ! -d integration_test/suites/tier0 ]]; then + echo "::error::This branch has no integration test suites yet, sync it with dev to run them" + exit 1 fi android-integration-tests: needs: check-suites - if: needs.check-suites.outputs.present == 'true' uses: ./.github/workflows/reusable-integration-test.yml with: ref: ${{ github.event.pull_request.head.sha || github.sha }} From 7e84412e02809152e09b07cd72f1242a7943dfbb Mon Sep 17 00:00:00 2001 From: Blazebrain Date: Sat, 26 Sep 2026 14:16:07 +0100 Subject: [PATCH 4/5] fix: test failure due to animation --- integration_test/core/app_launcher.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/integration_test/core/app_launcher.dart b/integration_test/core/app_launcher.dart index 6f12bec19..cdc48ab17 100644 --- a/integration_test/core/app_launcher.dart +++ b/integration_test/core/app_launcher.dart @@ -3,11 +3,15 @@ import "dart:async"; import "package:cake_wallet/main.dart" as app; import "package:flutter/foundation.dart"; import "package:flutter_test/flutter_test.dart"; +import "package:integration_test/integration_test.dart"; import "benign_errors.dart"; void integrationTest(String description, Future Function(WidgetTester tester) body) { testWidgets(description, (tester) async { + IntegrationTestWidgetsFlutterBinding.instance.framePolicy = + LiveTestWidgetsFlutterBindingFramePolicy.fullyLive; + final completer = Completer(); final run = runZonedGuarded(() async { From 88a7e72c4034e0b5aa3f868a6b1e9b2c031794a4 Mon Sep 17 00:00:00 2001 From: Blazebrain Date: Sun, 27 Sep 2026 07:31:13 +0100 Subject: [PATCH 5/5] fix: handle flushbar dismissal --- integration_test/core/app_launcher.dart | 4 ---- lib/src/screens/auth/auth_page.dart | 19 +++++++++++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/integration_test/core/app_launcher.dart b/integration_test/core/app_launcher.dart index cdc48ab17..6f12bec19 100644 --- a/integration_test/core/app_launcher.dart +++ b/integration_test/core/app_launcher.dart @@ -3,15 +3,11 @@ import "dart:async"; import "package:cake_wallet/main.dart" as app; import "package:flutter/foundation.dart"; import "package:flutter_test/flutter_test.dart"; -import "package:integration_test/integration_test.dart"; import "benign_errors.dart"; void integrationTest(String description, Future Function(WidgetTester tester) body) { testWidgets(description, (tester) async { - IntegrationTestWidgetsFlutterBinding.instance.framePolicy = - LiveTestWidgetsFlutterBindingFramePolicy.fullyLive; - final completer = Completer(); final run = runZonedGuarded(() async { diff --git a/lib/src/screens/auth/auth_page.dart b/lib/src/screens/auth/auth_page.dart index df1b72b39..495328468 100644 --- a/lib/src/screens/auth/auth_page.dart +++ b/lib/src/screens/auth/auth_page.dart @@ -116,9 +116,9 @@ class AuthPagePinCodeStateImpl extends AuthPageState { /// not the best scenario, but WidgetsBinding is not behaving correctly on Android await Future.delayed(Duration(milliseconds: 50)); - await _authBar?.dismiss(); + await _removeBar(_authBar); await Future.delayed(Duration(milliseconds: 50)); - await _progressBar?.dismiss(); + await _removeBar(_progressBar); await Future.delayed(Duration(milliseconds: 50)); if (route != null) { Navigator.of(_key.currentContext!).pushReplacementNamed(route, arguments: arguments); @@ -153,6 +153,21 @@ class AuthPagePinCodeStateImpl extends AuthPageState { ); } + Future _removeBar(Flushbar? bar) async { + final barRoute = bar?.flushbarRoute; + + if (bar == null || barRoute == null || !barRoute.isActive) { + return; + } + + if (bar.isShowing()) { + await bar.dismiss(); + return; + } + + barRoute.navigator?.removeRoute(barRoute); + } + void dismissFlushBar(Flushbar? bar) { WidgetsBinding.instance.addPostFrameCallback((_) async { await bar?.dismiss();