From 6167e62f8faf6052f7e937045a483956ec9b1987 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 16 Aug 2023 18:57:11 +0000 Subject: [PATCH] Fix FlutterInjectorTest assumptions about how the executor service assigns tasks to threads --- .../android/test/io/flutter/FlutterInjectorTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/platform/android/test/io/flutter/FlutterInjectorTest.java b/shell/platform/android/test/io/flutter/FlutterInjectorTest.java index 78c5431a0346e..1a72a0a56bb76 100644 --- a/shell/platform/android/test/io/flutter/FlutterInjectorTest.java +++ b/shell/platform/android/test/io/flutter/FlutterInjectorTest.java @@ -8,6 +8,7 @@ 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 void executorCreatesAndNamesNewThreadsByDefault() 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