From d6e6ce1af29b1cf39ade67ece666f766d3c9b8c2 Mon Sep 17 00:00:00 2001 From: Paul Butcher Date: Tue, 14 Jan 2025 21:41:55 +0000 Subject: [PATCH] spinlocks->eventually --- .../weco/pipeline/matcher/matcher/WorkMatcherTest.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 }