Index: /trunk/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java	(revision 18305)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java	(revision 18306)
@@ -10,5 +10,5 @@
 import java.util.concurrent.TimeUnit;
 
-import org.junit.Ignore;
+import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
@@ -27,4 +27,5 @@
 import org.openstreetmap.josm.testutils.mockers.WindowMocker;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Territories;
 
 import mockit.Invocation;
@@ -39,6 +40,16 @@
 class UploadActionTest {
     // Only needed for layer cleanup. And user identity cleanup. And ensuring that data isn't accidentally uploaded.
+    // Note that the setUp method can be replaced by the @Territories extension, when that is merged.
     @RegisterExtension
     JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().fakeAPI();
+
+    @BeforeAll
+    static void setUp() {
+        // Territories is needed due to test pollution. One of the listeners
+        // that may get registered on SelectionEventManager requires
+        // Territories. Rather unfortunately, we also need the external data to
+        // avoid the NPE.
+        Territories.initialize();
+    }
 
     /**
@@ -46,5 +57,4 @@
      */
     @Test
-    @Ignore("doesn't work on CI")
     void testNonRegression21476() {
         TestUtils.assumeWorkingJMockit();
