Stop parallel branch based on other branch's condition

Hi, I’m using OpenTAP through Keysight’s Test Automation software.
I need to start a script (script1), which i do not know a priori how long it is going to take.
In a parallel step, i need to record measurements from another script (script2).

How do i make script2 end when script1 ends?
I cannot find instructions in the documentation related to my case

Hi @mattia.lecci, and welcome to the forum!

Just to make sure I understand, you have a test plan like this, right?

  • Parallel
    • Script 1 : Must stop when script2 completes.
    • Script 2 : Does a measurement.

If that is correct, then the rest of my comment might make sense :slight_smile:

I think it depends a bit on what is the purpose of script 1, but you could do this:

Somehow you share a resource between the two scripts. This could be a unique string or something else you could base a lock on.

  • Parallel
    • Script1:
      - Do init thing
      - Wait for resource to be taken (new step?)
      - Wait for resource to be released (Lock step)
      - Do exit thing
    • Script2:
      - Take hold of resource (Lock step)
      - Do measurement
      - Release resource

I guess the ‘take hold of resource’ part could be done using a Lock step. I suggest you test that out a bit.

The problem is, we don’t have a step that can wait for someone else to take the lock, so you’d have to code that part up yourself.

For a good example, you can check out the Lock step from OpenTAP: opentap/LockStep.cs at main · opentap/opentap · GitHub

Hi Rolf, thank you for your suggestions!
We managed to make it work based on this locking mechanism!