fix(selfop): allow controlled manual collection in test

This commit is contained in:
2026-10-12 23:21:57 +08:00
parent 6e9f4b7932
commit 86e05a77e6
15 changed files with 160 additions and 20 deletions
@@ -90,7 +90,8 @@ public final class LingxingEgressGate {
}
private void check(EgressContext context) {
if (properties.collectionMode() == CollectionMode.OFF) throw failure("EGRESS_OFF");
if (properties.collectionMode() == CollectionMode.BUSINESS && !"production".equals(properties.environmentLabel()))
if (properties.collectionMode() == CollectionMode.BUSINESS
&& !("production".equals(properties.environmentLabel()) || "test".equals(properties.environmentLabel())))
throw failure("BUSINESS_ENVIRONMENT_REJECTED");
if (paused && (!recoverableRatePause || properties.collectionMode() != CollectionMode.BUSINESS
|| cooldownUntil == null || clock.instant().isBefore(cooldownUntil))) throw failure("ACCOUNT_PAUSED");