From 39daf76173c9f4985c70eca3ac80bd8fe5c949bc Mon Sep 17 00:00:00 2001
From: stedif <stefano.difrischia@inaf.it>
Date: Mon, 14 Feb 2022 16:20:29 +0100
Subject: [PATCH] L2SS-542: add time sleep to archiving tests

---
 sbin/run_integration_test.sh                                | 3 ++-
 .../integration_test/toolkit/test_archiver.py               | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh
index f795e982d..9c624fe40 100755
--- a/sbin/run_integration_test.sh
+++ b/sbin/run_integration_test.sh
@@ -40,7 +40,8 @@ make start sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim
 sleep 5
 
 make start device-boot device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-beam
-make start archiver-timescale hdbppts-cm hdbppts-es # starting order is important
+# Archive devices -> starting order is important
+make start archiver-timescale hdbppts-cm hdbppts-es
 
 # Give devices time to restart
 # TODO(Corne Lukken): Use a nicer more reliable mechanism
diff --git a/tangostationcontrol/tangostationcontrol/integration_test/toolkit/test_archiver.py b/tangostationcontrol/tangostationcontrol/integration_test/toolkit/test_archiver.py
index a890ab0af..dd4690d42 100644
--- a/tangostationcontrol/tangostationcontrol/integration_test/toolkit/test_archiver.py
+++ b/tangostationcontrol/tangostationcontrol/integration_test/toolkit/test_archiver.py
@@ -40,8 +40,6 @@ class TestArchiver(BaseIntegrationTestCase):
         """Test archiver configuration file"""
         config_dict = self.archiver.get_configuration()
         self.assertIsNotNone(config_dict)
-        # Apply the configuration file
-        self.archiver.apply_configuration(config_dict)
     
     def test_archive_scalar_attribute(self):
         """Test if a scalar attribute is correctly archived"""
@@ -58,6 +56,7 @@ class TestArchiver(BaseIntegrationTestCase):
         
         # Safety operation that prevents event subscriber to go in Fault state
         self.archiver.remove_attributes_in_error()
+        time.sleep(3)
         attr_fullname = 'stat/recv/1/recvtr_translator_busy_r'  # boolean
         self.archiver.add_attribute_to_archiver(attr_fullname, polling_period=1000, event_period=3000)
         time.sleep(3)
@@ -96,9 +95,10 @@ class TestArchiver(BaseIntegrationTestCase):
 
         # Safety operation that prevents event subscriber to go in Fault state
         self.archiver.remove_attributes_in_error()
+        time.sleep(3)
         attr_fullname = 'stat/sdp/1/fpga_temp_r'  # double
         self.archiver.add_attribute_to_archiver(attr_fullname, polling_period=1000, event_period=3000)
-        time.sleep(5)
+        time.sleep(3)
         # Test if the attribute has been correctly added to event subscriber
         self.assertTrue(self.archiver.is_attribute_archived(attr_fullname))
 
-- 
GitLab