Skip to content

sequence: Make it work even when a scan was aborted before preparation

Valentin Valls requested to merge fix-4214 into master

Closes #4214 (closed)

This PR makes sure the sequence continue even if a scan was properly killed.

This was tested with the following code:

diff --cc bliss/scanning/scan.py
index 32d80d2c3,32d80d2c3..8c9ed390c
--- a/bliss/scanning/scan.py
+++ b/bliss/scanning/scan.py
@@@ -1488,6 -1488,6 +1488,9 @@@ class Scan
              scan_id["collection"] = self.__scan_saving.collection_name
              scan_id["dataset"] = self.__scan_saving.dataset_name
  
++        if self.name == "fail_before_scan_data":
++            raise TimeoutError("Oupsi 1")
++
          self._scan_data = get_default_data_store().create_scan(
              identity=scan_id,
              info=self._scan_info,
diff --cc tests/scans/test_scan_sequence.py
index 21982816a,21982816a..1bd146194
--- a/tests/scans/test_scan_sequence.py
+++ b/tests/scans/test_scan_sequence.py
@@@ -309,7 -309,7 +309,7 @@@ def test_retry_interrupted_scans(sessio
      diode = session.config.get("diode")
  
      def run_sequence(seq_context: SequenceContext):
--        s1 = scans.loopscan(10, 1, diode, run=False)
++        s1 = scans.loopscan(10, 1, diode, run=False, name="fail_before_scan_data")
          try:
              with gevent.Timeout(1, TimeoutError):
                  seq_context.add_and_run(s1)

Merge request reports

Loading