Skip to content

Commit

Permalink
more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sils committed May 13, 2015
1 parent 0ee67ca commit ce235c3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions coalib/tests/processes/BarrierTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@

def proc_one(queue, barrier):
queue.put(1)
print("WAITING1")
barrier.wait()
print("PASSED1")
queue.put(2)


def proc_two(queue, barrier):
time.sleep(1)
time.sleep(2)
queue.put(1)
print("WAITING2")
barrier.wait()
print("PASSED2")
queue.put(2)


Expand All @@ -35,10 +39,8 @@ def test_barrier(self):
proc.join()

# Order will be wrong (1 2 1 2) if barrier doesn't work
self.assertEqual(queue.get(), 1)
self.assertEqual(queue.get(), 1)
self.assertEqual(queue.get(), 2)
self.assertEqual(queue.get(), 2)
for expected in [1, 1, 2, 2]:
self.assertEqual(queue.get(), expected)


if __name__ == '__main__':
Expand Down

0 comments on commit ce235c3

Please sign in to comment.