From a82d76049690abe522f13be96701553cfb7ea165 Mon Sep 17 00:00:00 2001
From: Simon Rose <simon.rose@ess.eu>
Date: Thu, 27 Jan 2022 09:43:57 +0100
Subject: [PATCH] Clear CA cache to fix intermittent PV get failure

---
 test/opcua_test_cases.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/opcua_test_cases.py b/test/opcua_test_cases.py
index ce3764e..8fa3d4a 100644
--- a/test/opcua_test_cases.py
+++ b/test/opcua_test_cases.py
@@ -1,4 +1,4 @@
-from epics import PV
+from epics import PV, ca
 from time import sleep
 from run_iocsh import IOC
 from os import environ
@@ -189,6 +189,8 @@ def test_inst():
     # Check server is stopped
     assert not test_inst.isServerRunning
 
+    ca.clear_cache()
+
 
 # test fixture for use with timezone server
 @pytest.fixture(scope="function")
@@ -214,6 +216,8 @@ def test_inst_TZ():
     # Check server is stopped
     assert not test_inst_TZ.isServerRunning
 
+    ca.clear_cache()
+
 
 class TestConnectionTests:
 
-- 
GitLab