Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Intermittent test failure: PocketUpdatesMiddlewareTest. WHEN SelectPocketStoriesCategory is dispatched THEN persist details in DataStore #21733

Closed
pocmo opened this issue Oct 6, 2021 · 2 comments
Assignees
Labels
eng:intermittent-test Evil test failures that only happen now-and-then and are a productivity killer needs:triage Issue needs triage

Comments

@pocmo
Copy link
Contributor

pocmo commented Oct 6, 2021

PocketUpdatesMiddlewareTest. WHEN SelectPocketStoriesCategory is dispatched THEN persist details in DataStore

java.lang.InstantiationError: kotlin.jvm.functions.Function2
	at jdk.internal.reflect.GeneratedSerializationConstructorAccessor256.newInstance(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:48)
	at io.mockk.proxy.jvm.ObjenesisInstantiator.instanceViaObjenesis(ObjenesisInstantiator.kt:75)
	at io.mockk.proxy.jvm.ObjenesisInstantiator.instance(ObjenesisInstantiator.kt:42)
	at io.mockk.impl.instantiation.JvmInstantiator$instantiate$2.invoke(JvmInstantiator.kt:16)
	at io.mockk.impl.instantiation.AbstractInstantiator.instantiateViaInstanceFactoryRegistry(AbstractInstantiator.kt:17)
	at io.mockk.impl.instantiation.JvmInstantiator.instantiate(JvmInstantiator.kt:15)
	at io.mockk.impl.recording.states.RecordingState$matcher$signatureValue$1$1.invoke(RecordingState.kt:49)
	at io.mockk.impl.instantiation.JvmAnyValueGenerator$anyValue$2.invoke(JvmAnyValueGenerator.kt:35)
	at io.mockk.impl.instantiation.AnyValueGenerator.anyValue(AnyValueGenerator.kt:34)
	at io.mockk.impl.instantiation.JvmAnyValueGenerator.anyValue(JvmAnyValueGenerator.kt:31)
	at io.mockk.impl.recording.states.RecordingState$matcher$signatureValue$1.invoke(RecordingState.kt:48)
	at io.mockk.impl.recording.JvmSignatureValueGenerator.signatureValue(JvmSignatureValueGenerator.kt:20)
	at io.mockk.impl.recording.states.RecordingState.matcher(RecordingState.kt:47)
	at io.mockk.impl.recording.CommonCallRecorder.matcher(CommonCallRecorder.kt:52)
	at org.mozilla.fenix.home.PocketUpdatesMiddlewareTest$WHEN SelectPocketStoriesCategory is dispatched THEN persist details in DataStore$1.invokeSuspend(PocketUpdatesMiddlewareTest.kt:188)
	at org.mozilla.fenix.home.PocketUpdatesMiddlewareTest$WHEN SelectPocketStoriesCategory is dispatched THEN persist details in DataStore$1.invoke(PocketUpdatesMiddlewareTest.kt)
	at org.mozilla.fenix.home.PocketUpdatesMiddlewareTest$WHEN SelectPocketStoriesCategory is dispatched THEN persist details in DataStore$1.invoke(PocketUpdatesMiddlewareTest.kt)
	at io.mockk.impl.eval.RecordedBlockEvaluator$record$block$2$1.invokeSuspend(RecordedBlockEvaluator.kt:28)
	at io.mockk.impl.eval.RecordedBlockEvaluator$record$block$2$1.invoke(RecordedBlockEvaluator.kt)
	at io.mockk.InternalPlatformDsl$runCoroutine$1.invokeSuspend(InternalPlatformDsl.kt:24)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)

https://firefoxci.taskcluster-artifacts.net/Io3wpEBLTDyjqaGjcHRjEQ/0/public/reports/test/testDebugUnitTest/index.html

┆Issue is synchronized with this Jira Task

@github-actions github-actions bot added the needs:triage Issue needs triage label Oct 6, 2021
@pocmo pocmo added the eng:intermittent-test Evil test failures that only happen now-and-then and are a productivity killer label Oct 6, 2021
@Mugurell Mugurell self-assigned this Oct 7, 2021
@Mugurell
Copy link
Contributor

Mugurell commented Oct 7, 2021

In the CI task for the proposed fix for this I saw another fail:

   TEST: GIVEN a category is selected WHEN that same category is clicked THEN deselect it and record telemetry
   FAILURE

 java.lang.AssertionError: Verification failed: call 1 of 1: MetricController(#1278).track(eq(PocketHomeRecsCategoryClicked(categoryname=cat2, previousSelectedCategoriesTotal=2, isSelectedNextState=false)))). No matching calls found.

 Calls to same method:
 1) MetricController(#1278).track(PocketHomeRecsCategoryClicked(categoryname=cat1, previousSelectedCategoriesTotal=1, isSelectedNextState=true))
 2) MetricController(#1278).track(PocketHomeRecsCategoryClicked(categoryname=cat2, previousSelectedCategoriesTotal=1, isSelectedNextState=false))

Will try covering this in the same PR.

@csadilek
Copy link
Contributor

This was fixed in 79a4873.

mergify bot pushed a commit that referenced this issue Nov 4, 2021
mergify bot pushed a commit that referenced this issue Nov 4, 2021
rocketsroger pushed a commit that referenced this issue Nov 4, 2021
…ort #21766) (#22326)

* For #21733 - Replace mock of an interface with mock of a fake.

(cherry picked from commit 4d5bd9e)

* For #21733 - Simplify test to not depend on store updates.

(cherry picked from commit 79a4873)

Co-authored-by: Mugurell <Mugurell@users.noreply.github.com>
pkirakosyan pushed a commit to gexsi/user-agent-android that referenced this issue Mar 7, 2022
pkirakosyan pushed a commit to gexsi/user-agent-android that referenced this issue Mar 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
eng:intermittent-test Evil test failures that only happen now-and-then and are a productivity killer needs:triage Issue needs triage
Projects
None yet
Development

No branches or pull requests

3 participants