Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openApp() never executes, but tests display as passed #1390

Open
bartekpacia opened this issue Jun 23, 2023 · 3 comments
Open

openApp() never executes, but tests display as passed #1390

bartekpacia opened this issue Jun 23, 2023 · 3 comments
Labels
bug Something isn't working platform: android Android is affected

Comments

@bartekpacia
Copy link
Contributor

bartekpacia commented Jun 23, 2023

Steps to reproduce

integration_test/example_test.dart

import 'package:flutter/material.dart';

import 'common.dart';

void main() {
  patrol(
    'counter state is the same after going to Home and switching apps',
    ($) async {
      await createApp($);

      await $(FloatingActionButton).tap();
      expect($(#counterText).text, '1');

      await $(#textField).enterText('Hello, Flutter!');
      expect($('Hello, Flutter!'), findsOneWidget);

      await $.native.pressHome(); // works
      await $.native.openApp(); // never gets called

      expect($(#counterText).text, '1');
      await $(FloatingActionButton).tap();

      expect($(#counterText).text, '2');
      expect($('Hello, Flutter!'), findsOneWidget);
    },
  );
}
  1. patrol test -t integration_test/example_test.dart in example app

Actual results

After pressHome() is executed, the app is never opened again. The CLI simply reports that tests passed after a few seconds. But if we look in the logcat, there's an exception saying that app couldn't be re-opened. See attached logcat below, search for Rejecting re-init on previously-failed class java.lang.Class.

Expected results

Tests should execute and pass.

If it fails, a crash should be reported.

Logs

logcat.txt

Device info

Motorola moto (g6) (XT-1925-5)
Android 9 (PPSS29.55-37-7-10)
Security Patch - 1st May 2020 (lol)

Patrol version

Latest master.

Flutter Doctor output

v3.10.5

@bartekpacia bartekpacia added the bug Something isn't working label Jun 23, 2023
@bartekpacia
Copy link
Contributor Author

Same issue occurs on Samsung Galaxy S9 with Android 10 (OneUI 2.5). The logs are different, though:

logcat.txt

Search for "openApp()". I didn't find the relevant logs, but I didn't try hard and long enough.

@bartekpacia bartekpacia changed the title openApp() crashes on Motorola Moto G6, but tests display as passed openApp() never executes, but tests display as passed Jun 23, 2023
@bartekpacia bartekpacia added the platform: android Android is affected label Jun 23, 2023
@bartekpacia
Copy link
Contributor Author

This issue does not occur on Samsung Galaxy S20 FE with Android 13.

galaxy.s20.fe.mp4

@bartekpacia
Copy link
Contributor Author

bartekpacia commented Jul 20, 2023

Occurs on Pixel 4 API 29 emulator. I looked at the logcat but didn't find anything suspicious, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: android Android is affected
Projects
None yet
Development

No branches or pull requests

1 participant