Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions espresso/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The following artifacts were released:
**Bug Fixes**

* Replace now-unnecessary reflection from TestLooperManagerCompat when using Android SDK 36 APIs
* Don't suppress AppNotIdleException if dumpThreadStates throws.

**New Features**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import android.os.Looper;
import androidx.test.espresso.util.StringJoinerKt;
import androidx.test.internal.platform.util.TestOutputEmitter;
import java.util.List;
import java.util.Locale;

Expand All @@ -31,7 +30,6 @@ public final class AppNotIdleException extends RuntimeException implements Espre

private AppNotIdleException(String description) {
super(description);
TestOutputEmitter.dumpThreadStates("ThreadState-AppNotIdleException.txt");
}

/**
Expand Down
10 changes: 9 additions & 1 deletion espresso/core/java/androidx/test/espresso/IdlingPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static androidx.test.internal.util.Checks.checkNotNull;

import android.util.Log;
import androidx.test.internal.platform.util.TestOutputEmitter;
import java.util.List;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -58,7 +59,14 @@ public TimeUnit getIdleTimeoutUnit() {
public void handleTimeout(List<String> busyResources, String message) {
switch (errorHandler) {
case THROW_APP_NOT_IDLE:
throw AppNotIdleException.create(busyResources, message);
AppNotIdleException appNotIdleException =
AppNotIdleException.create(busyResources, message);
try {
TestOutputEmitter.dumpThreadStates("ThreadState-AppNotIdleException.txt");
} catch (RuntimeException e) {
appNotIdleException.addSuppressed(e);
}
throw appNotIdleException;
case THROW_IDLE_TIMEOUT:
throw new IdlingResourceTimeoutException(busyResources);
case LOG_ERROR:
Expand Down
Loading