kiwix-android icon indicating copy to clipboard operation
kiwix-android copied to clipboard

UI fails to AutoConnect in the CI

Open gouri-panda opened this issue 2 years ago • 11 comments

Using 1.4.0 libraries and In espresso 3.4.0, I occasionally run into the following RuntimeException with a simple call to getInstance(InstrumentationRegistry.getInstrumentation())

org.kiwix.kiwixmobile.intro.IntroFragmentTest > viewIsSwipeableAndNavigatesToMain[test(AVD) - 5.0.2] FAILED java.lang.RuntimeException: Error while connecting UiAutomation at android.app.UiAutomation.connect(UiAutomation.java:210)

No tests particularly at this point. It fails sometimes on CI emulation at the start in both API 21 & API 30. More Context: https://issuetracker.google.com/issues/233914320

gouri-panda avatar Aug 17 '22 07:08 gouri-panda

@gouri-panda What is "1.4.0 libraries", which library you talk about exactly?

kelson42 avatar Aug 30 '22 03:08 kelson42

@kelson42 Sorry! That was a typo, I think! I have updated the description.

gouri-panda avatar Aug 30 '22 10:08 gouri-panda

@kelson42 @MohitMaliFtechiz In the meanwhile we should try not use this method getInstance(InstrumentationRegistry.getInstrumentation()).That's the only solution i can think of it now.

gouri-panda avatar Aug 31 '22 21:08 gouri-panda

@gouri-panda What is the purpose of this function? Could we avoid to use it at all?

kelson42 avatar Sep 01 '22 04:09 kelson42

@kelson42 It gets the UiDevice instance by InstrumentationRegistry.

Could we avoid to use it at all?

We should try an alternative way to find the UIDevice instance for the moment.

gouri-panda avatar Sep 01 '22 14:09 gouri-panda

@kelson42 @MohitMaliFtechiz I'm closing this issue unless we see this problem in our existing code.

gouri-panda avatar Sep 01 '22 15:09 gouri-panda

@gouri-panda problems should be trackef somrwhere in the repo.... even if root cause os outside

kelson42 avatar Sep 01 '22 17:09 kelson42

@gouri-panda I think to better understand this ticket, we shoudl update it with information allowing to answer the following questions:

  • Which test fails exactly? Is that always the same?
  • Does it always fail at the same place?
  • How often does it fails?
  • Does it fail only with emulator? Only with emulator in Github?
  • Does it fail always with the same API level (seems to always be a problem with API 21)?
  • Since when do we have the problem? What what the trigger?

kelson42 avatar Sep 03 '22 09:09 kelson42

@gouri-panda Any update/answer in view?

kelson42 avatar Sep 09 '22 04:09 kelson42

@kelson42 Not yet

gouri-panda avatar Sep 09 '22 07:09 gouri-panda

Which test fails exactly? Is that always the same?

There are no tests in particular. It doesn't fail in same test case.

Does it always fail at the same place?How often does it fails?

Some times

Does it fail only with emulator? Only with emulator in Github?

Only with the emulator in Github

Does it fail always with the same API level (seems to always be a problem with API 21)?

No

Since when do we have the problem? What what the trigger?

I don't know when it was started

gouri-panda avatar Sep 13 '22 11:09 gouri-panda

@MohitMaliFtechiz Would be great of you could fix this CI instability

kelson42 avatar Dec 30 '22 08:12 kelson42

hi @kelson42 , This should be automatically fixed in https://github.com/kiwix/kiwix-android/pull/3203.

MohitMaliFtechiz avatar Jan 11 '23 13:01 MohitMaliFtechiz