Skip to content

Commit 533acc8

Browse files
ychaparovcopybara-github
authored andcommitted
Do not reuse listener across tests
A single PlayerTestListener reused across tests may make flaky tests more difficult to debug - if multiple tests are run in one invocation. PiperOrigin-RevId: 756688056
1 parent 99d6c78 commit 533acc8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/transformer/src/androidTest/java/androidx/media3/transformer/CompositionPlayerSeekTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ public class CompositionPlayerSeekTest {
9595

9696
private final Context applicationContext =
9797
getInstrumentation().getContext().getApplicationContext();
98-
private final PlayerTestListener playerTestListener = new PlayerTestListener(TEST_TIMEOUT_MS);
9998

99+
private PlayerTestListener playerTestListener;
100100
private SurfaceView surfaceView;
101101

102102
@Before
103103
public void setUp() {
104+
playerTestListener = new PlayerTestListener(TEST_TIMEOUT_MS);
104105
rule.getScenario().onActivity(activity -> surfaceView = activity.getSurfaceView());
105106
}
106107

0 commit comments

Comments
 (0)