From 1c573b51654b1f926090856d617f9e9b100100fc Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 17 Aug 2023 13:37:59 -0700 Subject: [PATCH] Fix FlutterInjectorTest assumptions about how the executor service assigns tasks to threads (flutter/engine#44775) --- .../android/test/io/flutter/FlutterInjectorTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/test/io/flutter/FlutterInjectorTest.java b/engine/src/flutter/shell/platform/android/test/io/flutter/FlutterInjectorTest.java index 78c5431a03..1a72a0a56b 100644 --- a/engine/src/flutter/shell/platform/android/test/io/flutter/FlutterInjectorTest.java +++ b/engine/src/flutter/shell/platform/android/test/io/flutter/FlutterInjectorTest.java @@ -8,6 +8,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; import androidx.test.ext.junit.runners.AndroidJUnit4; import io.flutter.embedding.engine.deferredcomponents.PlayStoreDeferredComponentManager; @@ -73,8 +74,9 @@ public class FlutterInjectorTest { threadNames = injector.executorService().invokeAll(callables); assertEquals(threadNames.size(), 2); - assertEquals(threadNames.get(0).get(), "flutter-worker-0"); - assertEquals(threadNames.get(1).get(), "flutter-worker-1"); + for (Future name : threadNames) { + assertTrue(name.get().startsWith("flutter-worker-")); + } } @Test