Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8211b6a0 authored by vadimt's avatar vadimt Committed by Vadim Tryshev
Browse files

More diags for logic disabling other tests after a finalizer failure

Change-Id: I4af56b2b83b204b9a5a383a26a3d845a88a96bf1
parent 4e7a48f2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -78,10 +78,14 @@ public class FailureWatcher extends TestWatcher {
                try {
                    base.evaluate();
                } catch (Throwable e) {
                    if (!Log.getStackTraceString(e).contains(
                    final String stackTrace = Log.getStackTraceString(e);
                    if (!stackTrace.contains(
                            "androidx.test.internal.runner.junit4.statement.RunBefores.evaluate")) {
                        // Test failed to deinitialize. Since the global state is probably
                        // corrupted, won't execute other tests.
                        Log.d(TAG,
                                "Detected an exception from test finalizer, will skip further "
                                        + "tests: " + stackTrace);
                        sHadFailedTestDeinitialization = true;
                    }
                    throw e;