diff --git a/api/src/org/labkey/api/usageMetrics/UsageMetrics.java b/api/src/org/labkey/api/usageMetrics/UsageMetrics.java index 933966f6267..0061dc9c07d 100644 --- a/api/src/org/labkey/api/usageMetrics/UsageMetrics.java +++ b/api/src/org/labkey/api/usageMetrics/UsageMetrics.java @@ -253,8 +253,18 @@ public void testRepeatedDescriptions() metrics.put("count", 1L, "Things"); assertEquals(List.of(new Description("count", "Things", Kind.CURRENT)), metrics.getDescriptions()); - assertThrows(IllegalStateException.class, () -> metrics.put("count", 1L, "Other things")); - assertThrows(IllegalStateException.class, () -> metrics.describe("count", "Things", Kind.CUMULATIVE)); + if (AppProps.getInstance().isDevMode()) + { + assertThrows(IllegalStateException.class, () -> metrics.put("count", 1L, "Other things")); + assertThrows(IllegalStateException.class, () -> metrics.describe("count", "Things", Kind.CUMULATIVE)); + } + else + { + metrics.put("count", 2L, "Other things"); + metrics.describe("count", "Things", Kind.CUMULATIVE); + assertEquals(Map.of("count", 2L), metrics.getValues()); + assertEquals(List.of(new Description("count", "Things", Kind.CURRENT)), metrics.getDescriptions()); + } } @Test