ReplicationIT: don't wait a full retry window to prove non-replication
ReplicationIT takes ~343s (5m40s) while the rest of the build finishes
in seconds. Five of its 26 cases each burn ~62s; the rest run in <=2s.
All five bottom out on the replication retry quantum: a failed push is
rescheduled in TimeUnit.MINUTES (Destination#reschedule), so the
smallest non-zero retry is one minute and the tests set
replicationRetry=1. The three negative tests --
shouldNotDrainTheQueueWhenReloading,
shouldNotReplicateToNonMatchingRemote and
shouldNotReplicateProjectListedInProjectsAndExcludeProjects -- assert a
ref is never replicated by waiting for it and expecting the wait to
expire. They reuse TEST_TIMEOUT, which is sized to span a retry cycle
((delay + retry*60)+1 = 62s), so each burns the full minute only to
prove a negative.
Give those waits their own TEST_NOT_REPLICATED_TIMEOUT (replication
delay + push time + a few seconds cushion, ~7s), applied via a private
waitUntil(Supplier, Duration) overload in ReplicationIT.
This does not weaken the tests: waitUntil still throws on timeout, so
assertThrows still verifies non-replication -- only the wait shortens.
Replication is structurally suppressed in these cases (destination down,
project excluded, remote non-matching), so the ref can never appear;
were a regression to leak a push it would replicate within the ~1s
delay, well inside the window, and the assertion would then fail. The
shared TEST_REPLICATION_RETRY_MINUTES is left untouched so tests that
rely on the real one-minute retry (e.g. ReplicationStorageIT) keep their
timing.
The two remaining ~60s cases (new-project replication) genuinely wait a
retry: the first push fails as REPOSITORY_MISSING while the replica repo
is still being created, and that reason is retried on the minutes-based
delay. That is a separate, arguably production-side latency issue and is
handled in a follow-up.
Net, the three negatives drop from ~62s to ~7s each while the two
new-project cases are untouched here, so ReplicationIT drops from ~343s
to ~173s (~2x60s new-project waits + ~24 fast tests), all 26 green.
Change-Id: I2d561950e51761a1d1b0fe09dc50763b3e5421af
1 file changed