From e2024072ef90dcc9cc66c0fa06eed78b70d4579f Mon Sep 17 00:00:00 2001 From: ibaker Date: Wed, 28 Apr 2021 13:23:44 +0100 Subject: [PATCH] Fix flaky DRM assertion in AnalyticsCollectorTest Session pre-fetching caused this ordering assertion to no longer be always true. It should have been removed in https://github.com/google/ExoPlayer/commit/795ddfee40cba83eba8e9f39da01fba2f1f8775c #minor-release PiperOrigin-RevId: 370880530 --- .../exoplayer2/analytics/AnalyticsCollectorTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java index 4cf23e5ca9..bfe1f90a8a 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java @@ -1504,9 +1504,9 @@ public final class AnalyticsCollectorTest { assertThat(listener.getEvents(EVENT_DRM_SESSION_ACQUIRED)) .containsExactly(period0, period1) .inOrder(); - assertThat(listener.getEvents(EVENT_DRM_KEYS_LOADED)) - .containsExactly(period0, period1) - .inOrder(); + // The pre-fetched key load for period1 might complete before the blocking key load for period0, + // so we can't assert the order: + assertThat(listener.getEvents(EVENT_DRM_KEYS_LOADED)).containsExactly(period0, period1); // The period1 release event is lost because it's posted to "ExoPlayerTest thread" after that // thread has been quit during clean-up. assertThat(listener.getEvents(EVENT_DRM_SESSION_RELEASED)).containsExactly(period0);