From 8d5a7606f44c2f9bdeaf054de30fcca8b9abdc26 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Thu, 16 Sep 2021 10:48:28 -0700 Subject: [PATCH] [fenix] Closes https://github.com/mozilla-mobile/fenix/issues/21335: return self instead of mock in FenixSnackbarKtTest. This is a speculative fix for the intermittent issue. Typically, these intermittents are caused by mocked lambdas but there is no mocked lambda here. If this doesn't work, one `any()` argument fills in for a lambda: it's possible that's causing the failure. Unfortunately, I can't verify this fix easily because the "run test until failure" option was removed from Android Studio. See d396c9eb41298cc07fbf136f1de971010bc45d97 for a prior attempt to address the intermittents in this class. --- .../org/mozilla/fenix/tabstray/ext/FenixSnackbarKtTest.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/test/java/org/mozilla/fenix/tabstray/ext/FenixSnackbarKtTest.kt b/app/src/test/java/org/mozilla/fenix/tabstray/ext/FenixSnackbarKtTest.kt index b2ad856d4..1b286e1f8 100644 --- a/app/src/test/java/org/mozilla/fenix/tabstray/ext/FenixSnackbarKtTest.kt +++ b/app/src/test/java/org/mozilla/fenix/tabstray/ext/FenixSnackbarKtTest.kt @@ -1,3 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + package org.mozilla.fenix.tabstray.ext import android.content.Context @@ -74,7 +78,7 @@ class FenixSnackbarKtTest { every { snackbar.setAnchorView(anchor) }.answers { snackbar } every { snackbar.view }.answers { view } - every { snackbar.setAction(any(), any()) }.answers { mockk(relaxed = true) } + every { snackbar.setAction(any(), any()) }.answers { snackbar } every { snackbar.anchorView }.answers { anchor } snackbar.anchorWithAction(anchor, {})