From 4a9a11e170ebcc47ef20f7055184ce66f7994415 Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Tue, 15 Feb 2022 09:29:32 +0000 Subject: Fix intermittent failure in metrics test When the registry is cleared, it removes the Prometheus counters that are initialized by static definition causing the metrics test to fail. This issue occurs when this test is not invoked first in the order of test execution in feature-lifecycle. Issue-ID: POLICY-3832 Signed-off-by: zrrmmua Change-Id: I9a55910bc39dbe1ad9f1153809bdf78bac3040b1 --- .../onap/policy/drools/server/restful/RestLifecycleManagerTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'feature-lifecycle') diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java index b8139e6e..7676929d 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -109,7 +110,6 @@ public class RestLifecycleManagerTest { */ @Before public void setUp() throws Exception { - CollectorRegistry.defaultRegistry.clear(); SystemPersistenceConstants.getManager().setConfigurationDir("target/test-classes"); fsm = newFsmInstance(); @@ -170,7 +170,6 @@ public class RestLifecycleManagerTest { PolicyControllerConstants.getFactory().destroy(); SystemPersistenceConstants.getManager().setConfigurationDir(null); - CollectorRegistry.defaultRegistry.clear(); } @Test -- cgit 1.2.3-korg