Skip to content

Conversation

@dabrynskiy
Copy link
Contributor

@dabrynskiy dabrynskiy commented Jul 20, 2025

Description of the problem:
Teardown from rule androidx.test.ext.junit.rules.ActivityScenarioRule waits for idle state before destroing activity.
In case of AppNotIdle exception error this results in infinite test execution.
In order to reproduce the problem in sample-app the activity BusyActivity was added, a test was added that launches this activity com.atiurin.sampleapp.tests.espresso.UltronActivityRuleTest#appNotIdle

Changes:
Added rule com.atiurin.ultron.testlifecycle.activity.UltronActivityRule - is a reduced copy from androidx.test.ext.junit.rules.ActivityScenarioRule. com.atiurin.ultron.testlifecycle.activity.UltronActivityRule
finishing all activities in the RESUMED, PAUSED, STOPPED stage without wait idle state

counter = -1,
key = "LAUNCH ACTIVITY",
name = "SetUp 'launch activity'",
actions = { scenario = scenarioSupplier.get() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions = { scenario = scenarioSupplier.get() }
replace with
actions = { launchActivity() }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@alex-tiurin alex-tiurin merged commit 3f26b7a into open-tool:master Oct 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants