Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Both files will show which nodes are holding, and include the state of the holding trigger expressions.
def simulate_deadlock():

This simulation is expected to fail, since we have a deadlock/ race condition

Code Block
defs = ecflow.Defs() # create a empty defs

...


suite = defs.add_suite("dead_lock")

...


fam = suite.add_family("family")

...


fam.add_task("t1").add_trigger("t2 == complete")

...


fam.add_task("t2").add_trigger("t1 == complete")

...


theResult = defs.simulate(); # simulate the definition

...


assert len(theResult) != 0, "Expected simulation to return errors"

...

 
print theResult

...


if _name_ == "_main_":

...


    simulate_deadlock()