From 6a5a464ca8bccc71ab675dc7ef8b2e71c5d5ed3c Mon Sep 17 00:00:00 2001 From: Andre Kurait Date: Tue, 17 Nov 2026 14:50:18 -0600 Subject: [PATCH] test(emr): move Hive and Spark steps to nightly checks (#8738) * test(emr): move Hive steps to nightly checks alongside session checks * test(emr): declare nightly Hive and Spark timeout --- .github/ci/partition.sh | 12 +++------ .github/ci/prefetch-images.sh | 8 +++--- .github/ci/test_partition.py | 25 ++++++++----------- .github/workflows/nightly-checks.yml | 7 +++--- ...> EmrHiveStepsNightlyIntegrationTest.java} | 5 +++- 5 files changed, 27 insertions(+), 30 deletions(-) rename src/test/java/io/floci/aws/services/emr/{EmrHiveStepsDockerIntegrationTest.java => EmrHiveStepsNightlyIntegrationTest.java} (98%) diff --git a/.github/ci/partition.sh b/.github/ci/partition.sh index 65b634f058..2f24380adf 100755 --- a/.github/ci/partition.sh +++ b/.github/ci/partition.sh @@ -22,16 +22,12 @@ import sys AUGMENTATION_WEIGHT = 10 # one augmentation ~ 5.4s ~ 10 average test classes -# Classes that take far longer than the suite's average, by class name, which a package rename -# leaves alone, with the seconds they take on GitHub's runners. Each of these two is worth some -# 220 average classes, and the shard that held them both ran over 200s longer than any other -# (1246s of Surefire's 1500s, against 641s to 869s for the rest). A shard's other classes are -# packed around them; a class that stops being this slow only leaves the shards a little uneven. -# They took 651s and 402s on 2026-11-12, once their cases had grown, and weighed at 280s and 260s -# their shard ran into Surefire's 1500s while the others finished in 16 to 20 minutes. +# Classes that take far longer than the suite's average, keyed by class name so package renames +# retain their weight. The EMR runner took 651s on GitHub's runners on 2026-11-12; at its old +# 280s weight, its shard ran into Surefire's 1500s while others finished in 16 to 20 minutes. +# Hive steps now run only in nightly checks and no longer need a routine-shard weight. SLOW_CLASSES = { 'EmrDockerRunnerDockerIntegrationTest': 650, - 'EmrHiveStepsDockerIntegrationTest': 400, } SECONDS_PER_CLASS = 1.2 # the suite's mean: 4212s over 3451 classes on 2026-11-09 diff --git a/.github/ci/prefetch-images.sh b/.github/ci/prefetch-images.sh index 8b7c9d9685..40a212dc81 100755 --- a/.github/ci/prefetch-images.sh +++ b/.github/ci/prefetch-images.sh @@ -113,19 +113,19 @@ starts SwfLambdaIntegrationTest && ecr public.ecr.aws/lambda/python:3.12 starts ElbV2LambdaTargetDataPlaneIntegrationTest && ecr public.ecr.aws/lambda/python:3.14 # EmrDockerRunnerDockerIntegrationTest runs EMR steps and EMR Serverless job runs in the emr-7.5.0 image the runner's # default template names (EmrServerlessSparkRunner), 3.5 GB, so it is queued last, behind the Lambda runtimes; -# EmrHiveStepsDockerIntegrationTest runs a cluster's other steps in it. Of the nightly checks, +# Of the nightly checks, EmrHiveStepsNightlyIntegrationTest runs a cluster's other steps in it, # EmrServerlessCustomImageNightlyIntegrationTest builds its custom image on it, # EmrFlociContainerNightlyIntegrationTest runs a cluster's steps in it from Floci in a container, and # EmrPigStepsNightlyIntegrationTest a cluster's Pig steps. -starts EmrDockerRunnerDockerIntegrationTest EmrHiveStepsDockerIntegrationTest EmrServerlessCustomImageNightlyIntegrationTest \ +starts EmrDockerRunnerDockerIntegrationTest EmrHiveStepsNightlyIntegrationTest EmrServerlessCustomImageNightlyIntegrationTest \ EmrFlociContainerNightlyIntegrationTest EmrPigStepsNightlyIntegrationTest EmrNotebookExecutionNightlyIntegrationTest \ && ecr public.ecr.aws/emr-serverless/spark/emr-7.5.0:latest -# EmrServerlessHiveDockerIntegrationTest runs EMR Serverless Hive job runs, and EmrHiveStepsDockerIntegrationTest EMR +# EmrServerlessHiveDockerIntegrationTest runs EMR Serverless Hive job runs, and EmrHiveStepsNightlyIntegrationTest EMR # Hive steps, in the emr-7.5.0 Hive image the runner's default Hive template names, 2.7 GB; every EMR cluster runs its # HDFS in it, EmrDockerRunnerDockerIntegrationTest's and the nightly EmrFlociContainerNightlyIntegrationTest's, # EmrPigStepsNightlyIntegrationTest's and EmrSessionServerNightlyIntegrationTest's included (an emr-spark-* cluster's # Hadoop comes from it too). -starts EmrServerlessHiveDockerIntegrationTest EmrHiveStepsDockerIntegrationTest EmrDockerRunnerDockerIntegrationTest \ +starts EmrServerlessHiveDockerIntegrationTest EmrHiveStepsNightlyIntegrationTest EmrDockerRunnerDockerIntegrationTest \ EmrFlociContainerNightlyIntegrationTest EmrPigStepsNightlyIntegrationTest EmrSessionServerNightlyIntegrationTest \ EmrNotebookExecutionNightlyIntegrationTest \ && ecr public.ecr.aws/emr-serverless/hive/emr-7.5.0:latest diff --git a/.github/ci/test_partition.py b/.github/ci/test_partition.py index 19b35b99cb..5181afc92f 100644 --- a/.github/ci/test_partition.py +++ b/.github/ci/test_partition.py @@ -98,11 +98,11 @@ class PartitionTest(unittest.TestCase): self.assertEqual([['p/EmrDockerRunnerDockerIntegrationTest'], plain], shards) def test_a_group_holding_a_slow_class_is_placed_before_a_larger_group(self): - self.source('p/EmrHiveStepsDockerIntegrationTest', '@TestProfile(Docker.class)') + self.source('p/EmrDockerRunnerDockerIntegrationTest', '@TestProfile(Docker.class)') for name in ('p/A', 'p/B', 'p/C', 'p/D'): self.source(name, '@TestProfile(Zeta.class)') - shards = self.shards(['p/A', 'p/B', 'p/C', 'p/D', 'p/EmrHiveStepsDockerIntegrationTest'], 2) - self.assertEqual(['p/EmrHiveStepsDockerIntegrationTest'], shards[0]) + shards = self.shards(['p/A', 'p/B', 'p/C', 'p/D', 'p/EmrDockerRunnerDockerIntegrationTest'], 2) + self.assertEqual(['p/EmrDockerRunnerDockerIntegrationTest'], shards[0]) def test_a_slow_class_without_a_profile_is_placed_before_the_others(self): plain = ['p/A', 'p/B', 'p/C'] @@ -111,27 +111,24 @@ class PartitionTest(unittest.TestCase): def test_a_slow_class_is_known_by_its_name_whatever_its_package(self): plain = ['some/other/C%03d' % n for n in range(40)] - shards = self.shards(['some/where/EmrHiveStepsDockerIntegrationTest'] + plain, 2) - self.assertEqual(['some/where/EmrHiveStepsDockerIntegrationTest'], shards[0]) + shards = self.shards(['some/where/EmrDockerRunnerDockerIntegrationTest'] + plain, 2) + self.assertEqual(['some/where/EmrDockerRunnerDockerIntegrationTest'], shards[0]) - def test_two_slow_classes_of_one_profile_are_separate_from_each_other_and_ordinary_members(self): + def test_a_slow_class_is_separate_from_ordinary_members_of_its_profile(self): self.source('p/EmrDockerRunnerDockerIntegrationTest', '@TestProfile(Docker.class)') - self.source('p/EmrHiveStepsDockerIntegrationTest', '@TestProfile(Docker.class)') self.source('p/A', '@TestProfile(Docker.class)') self.source('p/B', '@TestProfile(Docker.class)') - classes = ['p/EmrDockerRunnerDockerIntegrationTest', 'p/EmrHiveStepsDockerIntegrationTest', 'p/A', 'p/B'] - shards = self.shards(classes, 3) - self.assertEqual([['p/EmrDockerRunnerDockerIntegrationTest'], - ['p/EmrHiveStepsDockerIntegrationTest'], ['p/A', 'p/B']], shards) + classes = ['p/EmrDockerRunnerDockerIntegrationTest', 'p/A', 'p/B'] + self.assertEqual([['p/EmrDockerRunnerDockerIntegrationTest'], ['p/A', 'p/B']], + self.shards(classes, 2)) def test_a_slow_class_that_no_longer_exists_is_named_and_changes_nothing(self): - self.classes.write_text('p/A\np/EmrHiveStepsDockerIntegrationTest\n') + self.classes.write_text('p/A\np/B\n') result = self.invoke(2, 1) self.assertEqual(0, result.returncode, result.stderr) - self.assertEqual('p/EmrHiveStepsDockerIntegrationTest\n', result.stdout) + self.assertEqual('p/A\n', result.stdout) self.assertIn('::warning title=partition.sh::stale SLOW_CLASSES key: no test class named ' 'EmrDockerRunnerDockerIntegrationTest', result.stderr) - self.assertNotIn('EmrHiveStepsDockerIntegrationTest', result.stderr) def test_invalid_shard_arguments_fail_without_emitting_assignments(self): self.classes.write_text('p/A\np/B\n') diff --git a/.github/workflows/nightly-checks.yml b/.github/workflows/nightly-checks.yml index 040ec3fac0..eea572df83 100644 --- a/.github/workflows/nightly-checks.yml +++ b/.github/workflows/nightly-checks.yml @@ -32,10 +32,11 @@ jobs: # twenty minutes for the build, the image and the prefetch: EmrPigStepsNightlyIntegrationTest's 30, # EmrFlociContainerNightlyIntegrationTest's 20 and 4 for its setup, # EmrServerlessCustomImageNightlyIntegrationTest's 85 and 21 for its setup, - # EmrServerlessSparkConnectNightlyIntegrationTest's 30, EmrSessionServerNightlyIntegrationTest's 40, and - # EmrNotebookExecutionNightlyIntegrationTest's 40, 270 in all. A check added, or a bound raised, raises this with it, + # EmrServerlessSparkConnectNightlyIntegrationTest's 30, EmrSessionServerNightlyIntegrationTest's 40, + # EmrHiveStepsNightlyIntegrationTest's five two-minute tests, one five-minute test and six-minute setup, and + # EmrNotebookExecutionNightlyIntegrationTest's 40, 291 in all. A check added, or a bound raised, raises this with it, # so a slow check fails with its own message rather than the job being cancelled with none. - timeout-minutes: 290 + timeout-minutes: 311 # A fork's schedule would spend its owner's minutes on checks it never asked for; a draft waits until it is # ready for review, as the CI shards do. if: >- diff --git a/src/test/java/io/floci/aws/services/emr/EmrHiveStepsDockerIntegrationTest.java b/src/test/java/io/floci/aws/services/emr/EmrHiveStepsNightlyIntegrationTest.java similarity index 98% rename from src/test/java/io/floci/aws/services/emr/EmrHiveStepsDockerIntegrationTest.java rename to src/test/java/io/floci/aws/services/emr/EmrHiveStepsNightlyIntegrationTest.java index 94f3d84ac2..32eb766d89 100644 --- a/src/test/java/io/floci/aws/services/emr/EmrHiveStepsDockerIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/emr/EmrHiveStepsNightlyIntegrationTest.java @@ -20,6 +20,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.extension.RegisterExtension; import software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.regions.Region; @@ -52,7 +53,8 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue; @QuarkusTest @TestProfile(ContainerDataPlaneProfile.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -class EmrHiveStepsDockerIntegrationTest { +@EnabledIfSystemProperty(named = "nightly.checks.enabled", matches = "true") +class EmrHiveStepsNightlyIntegrationTest { private static final ObjectMapper JSON = new ObjectMapper(); private static final String REGION = "us-east-1"; @@ -94,6 +96,7 @@ class EmrHiveStepsDockerIntegrationTest { } @Test + @Timeout(value = 5, unit = TimeUnit.MINUTES) void hiveAndSparkStepsShareTheClustersMetastoreServiceAndHdfs() { // The two steps that read what the first one made, and need nothing from each other, run at once. startCluster(HIVE_AND_SPARK, "[]", null, 2);