Reduce #deeplyNestedSetFilteredQuickly unit test work by 90% to deflake.
This test runs with a 10 second timeout and does a large amount of work to confirm
that the underlying code is running in linear, not quadratic time. Unfortunately on
Bazel CI, even running in linear time, the CI worker sometimes fails to complete
the test within 10 seconds.
Since the workers are flaking doing linear work on 5000 items, we can reduce the
work to 500 and still catch a quadratic bug, since 500*500=250000 is well over 5000.
RELNOTES: None.
PiperOrigin-RevId: 407653651
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/SuccessfulArtifactFilterTest.java b/src/test/java/com/google/devtools/build/lib/analysis/SuccessfulArtifactFilterTest.java
index 21276d5..3d95041 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/SuccessfulArtifactFilterTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/SuccessfulArtifactFilterTest.java
@@ -217,10 +217,10 @@
NestedSetBuilder.<Artifact>stableOrder().add(builtArtifact).add(failedArtifact).build();
List<NestedSet<Artifact>> sets = new ArrayList<>();
sets.add(baseSet);
- // Create a NestedSet DAG with ((5000 * 4999) / 2) nodes, but with only 5000 unique nodes. It
+ // Create a NestedSet DAG with ((500 * 499) / 2) nodes, but with only 500 unique nodes. It
// should be feasible to filter this NestedSet using memoization in a small test and we should
// timeout if we aren't using memoization.
- for (int i = 0; i < 5000; i++) {
+ for (int i = 0; i < 500; i++) {
NestedSetBuilder<Artifact> builder = NestedSetBuilder.stableOrder();
builder.add(builtArtifact).add(failedArtifact);
for (NestedSet<Artifact> set : sets) {