Skip to content

Commit

Permalink
FIX: deterministic testing change
Browse files Browse the repository at this point in the history
  • Loading branch information
joshc-slac committed Sep 3, 2024
1 parent 49160d1 commit b4d5133
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions beams/tests/test_sequencer_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,3 @@ def test_get_command_reply(self):
assert y[SequencerStateVariable.STATUS.value] == TickStatus.UNKNOWN
assert y[SequencerStateVariable.RUN_STATE.value] == RunStateType.STATE_UNKNOWN
assert y["mess_t"] == MessageType.MESSAGE_TYPE_COMMAND_REPLY

def test_multi_access(self):
x = SequencerState()

def proc1work(x):
print("proc1 a go")
x.set_value(SequencerStateVariable.RUN_STATE, RunStateType.TICKING)

def proc2work(x):
print("proc2 a go")
while x.get_value(SequencerStateVariable.RUN_STATE) != RunStateType.TICKING:
print("waiting for get value to return true")
time.sleep(0.1)

assert x.get_value(SequencerStateVariable.RUN_STATE) == RunStateType.TICKING

proc1 = Process(target=proc1work, args=(x,))
proc2 = Process(target=proc2work, args=(x,))
proc2.start()
time.sleep(0.4)
proc1.start()

0 comments on commit b4d5133

Please sign in to comment.