diff --git a/pipeline/matcher_merger/matcher/src/test/scala/weco/pipeline/matcher/matcher/WorkMatcherTest.scala b/pipeline/matcher_merger/matcher/src/test/scala/weco/pipeline/matcher/matcher/WorkMatcherTest.scala index 809d280c08..8d553b9579 100644 --- a/pipeline/matcher_merger/matcher/src/test/scala/weco/pipeline/matcher/matcher/WorkMatcherTest.scala +++ b/pipeline/matcher_merger/matcher/src/test/scala/weco/pipeline/matcher/matcher/WorkMatcherTest.scala @@ -404,7 +404,9 @@ class WorkMatcherTest _ == SubgraphId(idA, idB) ) == 0 ) { - while (!cHasReadGraph) {} + eventually(timeout = timeout(5 seconds)) { + if (!cHasReadGraph) throw new Exception("not yet") + } } // (**) We don't let the update to 'C' start writing graph updates until @@ -417,7 +419,10 @@ class WorkMatcherTest )) && createdLocksHistory.count(_ == SubgraphId(idA, idB)) == 1 ) { - while (locks.contains(idA.underlying)) {} + eventually(timeout = timeout(5 seconds)) { + if (locks.contains(idA.underlying)) + throw new Exception("not yet") + } } createdLocksHistory = createdLocksHistory :+ id }