summaryrefslogtreecommitdiffstats
path: root/config-model/src/test
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2021-02-03 12:33:15 +0100
committerGitHub <noreply@github.com>2021-02-03 12:33:15 +0100
commite4e9ac3e2d0ecab4f506be232d1f838bcec5b4db (patch)
treeee7939d64567e0eee0842cee9ae9c413496729df /config-model/src/test
parentc9d9ba5e0944832c4a91976f5140b85e26608a65 (diff)
parent3732b858e75a251bbc11417a49a7e9947f0b7bc9 (diff)
Merge pull request #16362 from vespa-engine/ogronnesby/improve-quota-errors
Improve the quota error messages
Diffstat (limited to 'config-model/src/test')
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java
index d3c41754c8d..d9f9b602fea 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/QuotaValidatorTest.java
@@ -47,7 +47,7 @@ public class QuotaValidatorTest {
tester.deploy(null, getServices("testCluster", 10), Environment.prod, null);
fail();
} catch (RuntimeException e) {
- assertEquals("Hourly spend for maximum specified resources ($-.--) exceeds budget from quota ($-.--)!",
+ assertEquals("Please free up some quota! This deployment's quota use ($-.--) exceeds reserved quota ($-.--)!",
ValidationTester.censorNumbers(e.getMessage()));
}
}
@@ -59,7 +59,20 @@ public class QuotaValidatorTest {
tester.deploy(null, getServices("testCluster", 10), Environment.prod, null);
fail();
} catch (RuntimeException e) {
- assertEquals("publiccd: Hourly spend for maximum specified resources ($-.--) exceeds budget from quota ($-.--)!",
+ assertEquals("publiccd: Please free up some quota! This deployment's quota use ($-.--) exceeds reserved quota ($-.--)!",
+ ValidationTester.censorNumbers(e.getMessage()));
+ }
+ }
+
+ @Test
+ public void test_deploy_with_negative_budget() {
+ var quota = Quota.unlimited().withBudget(BigDecimal.valueOf(-1));
+ var tester = new ValidationTester(10, false, new TestProperties().setHostedVespa(true).setQuota(quota).setZone(publicZone));
+ try {
+ tester.deploy(null, getServices("testCluster", 10), Environment.prod, null);
+ fail();
+ } catch (RuntimeException e) {
+ assertEquals("Please free up some quota! This deployment's quota use is ($-.--) and reserved quota is below zero! ($--.--)",
ValidationTester.censorNumbers(e.getMessage()));
}
}