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

Flaky UI tests: ConcurrentModificationException #302

Closed
TWiStErRob opened this issue Jul 26, 2023 · 6 comments · Fixed by #313
Closed

Flaky UI tests: ConcurrentModificationException #302

TWiStErRob opened this issue Jul 26, 2023 · 6 comments · Fixed by #313
Labels
a:bug something isn't working as expected in:ci in:test unit, or UI tests

Comments

@TWiStErRob
Copy link
Owner

TWiStErRob commented Jul 26, 2023

https://issuetracker.google.com/issues/293190504

Causes process crashed, rerun is mandatory because not all tests have been completed.

java.util.ConcurrentModificationException
at java.util.WeakHashMap$HashIterator.next(WeakHashMap.java:165)
at androidx.core.view.ViewCompat$AccessibilityPaneVisibilityManager.onGlobalLayout(ViewCompat.java:4552)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:815)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1867)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5779)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

Few examples:


testMove (net.twisterrob.inventory.android.activity.RoomViewActivityTest_Move) failed
Move files from master branch to their place android\backup\src\main\… #243
https://github.com/TWiStErRob/net.twisterrob.inventory/actions/runs/5656869563/job/15330638805
Instrumentation Test Results 21.zip

testMoveAlreadyExists (net.twisterrob.inventory.android.activity.RoomViewActivityTest_Move) failed
https://github.com/TWiStErRob/net.twisterrob.inventory/actions/runs/5656869563/job/15326709383
Attempt 1, second attempt cleared artifacts.


testMove (net.twisterrob.inventory.android.activity.RoomViewActivityTest_Move) failed
Move to proper Dependency Injection where possible (#279) #177
https://github.com/TWiStErRob/net.twisterrob.inventory/actions/runs/5338323603/job/14464784986
Potentially after com.android.documentsui was still open at the end of the test, pressing Back 1 times and Home 0 times helped kill it.
Instrumentation Test Results 21.zip
`


testAddPropertyCancel (net.twisterrob.inventory.android.activity.MainActivityTest_Properties) failed
Improve names #221
https://github.com/TWiStErRob/net.twisterrob.inventory/actions/runs/5510973972/job/14920787170
Potentially after com.android.documentsui was still open at the end of the test, pressing Back 1 times and Home 0 times helped kill it.
Instrumentation Test Results 21.zip


testTypeClearClose (net.twisterrob.inventory.android.activity.MainActivityTest_Search) failed
Reset trigger #237
https://github.com/TWiStErRob/net.twisterrob.inventory/actions/runs/5578805112/job/15108021643
Instrumentation Test Results 21.zip


testTypeClearClose (net.twisterrob.inventory.android.activity.MainActivityTest_Search) failed
Merge branch 'main' into fix235 #252
https://github.com/TWiStErRob/net.twisterrob.inventory/actions/runs/5667930378/job/15358516305
Standalone failure, testPrepareVersion1 failed on previous commit too, and it didn't open any UI.
Instrumentation Test Results 21.zip

@TWiStErRob TWiStErRob added a:bug something isn't working as expected in:test unit, or UI tests in:ci labels Jul 26, 2023
@TWiStErRob TWiStErRob added this to the vNext milestone Jul 26, 2023
@TWiStErRob
Copy link
Owner Author

testFinds (net.twisterrob.inventory.android.activity.MainActivityTest_Search) failed
Latest stable libs #253
https://github.com/TWiStErRob/net.twisterrob.inventory/actions/runs/5670443421/job/15373232593
Instrumentation Test Results 21.zip

@TWiStErRob
Copy link
Owner Author

testTypeClose (net.twisterrob.inventory.android.activity.MainActivityTest_Search) failed
Move from startService to enqueueWork #260
https://github.com/TWiStErRob/net.twisterrob.inventory/pull/305/checks?check_run_id=15403884642
Instrumentation Test Results 21.zip

@TWiStErRob
Copy link
Owner Author

TWiStErRob commented Jul 27, 2023

net.twisterrob.inventory.android.activity.ItemViewActivityTest_Move > testMoveToRoomInAnotherPropertyWithContents[test(AVD) - 5.0.2] FAILED
https://github.com/TWiStErRob/net.twisterrob.inventory/actions/runs/5683533632 (attempt 1)
Crashed so hard there's no TEST-.xml files
Instrumentation Test Results 21 (3).zip

@TWiStErRob
Copy link
Owner Author

testMoveAlreadyExists (net.twisterrob.inventory.android.activity.RoomViewActivityTest_Move) failed
Enable animation-problematic tests on CI, animations are turned off. #269
https://github.com/TWiStErRob/net.twisterrob.inventory/pull/308/checks?check_run_id=15628782022
Instrumentation Test Results 21.zip

@TWiStErRob
Copy link
Owner Author

TWiStErRob commented Aug 5, 2023

Happened locally with gradlew :android:connectedCheck -Pandroid.testInstrumentationRunnerArguments.class=com.example.TestClass --no-daemon.

this class
package com.example;

import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;

import androidx.test.ext.junit.runners.AndroidJUnit4;

import net.twisterrob.inventory.android.activity.MainActivity;
import net.twisterrob.inventory.android.test.InventoryActivityRule;
import net.twisterrob.inventory.android.test.actors.MainActivityActor;
import net.twisterrob.inventory.android.test.categories.On;

@RunWith(AndroidJUnit4.class)
@Category({On.Main.class})
public class TestClass {

	@SuppressWarnings("deprecation")
	@Rule public final androidx.test.rule.ActivityTestRule<MainActivity> activity =
			new InventoryActivityRule<>(MainActivity.class);

	private final MainActivityActor main = new MainActivityActor();

	@Ignore("Not implemented yet")
	@Test public void testIgnored() {
		main.openItems();
	}

	@Test public void testSuccess() {
		main.openSunburst();
	}

	@Test public void testFailure() {
		fail("fail");
		main.openBackup();
	}

	@Test public void testSuccess2() {
		main.openSettings();
	}

	@Test public void testAssume() {
		//noinspection DataFlowIssue
		assumeTrue("assume", false);
		main.openAbout();
	}
}

testAssume failed before it can fail on assume.

results.zip
apks.zip

@TWiStErRob
Copy link
Owner Author

TWiStErRob commented Aug 8, 2023

testClose (net.twisterrob.inventory.android.activity.MainActivityTest_Search) failed
Fix lifecycle #282
https://github.com/TWiStErRob/net.twisterrob.inventory/pull/307/checks?check_run_id=15714221465
no logcat or report :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug something isn't working as expected in:ci in:test unit, or UI tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant