twitter-archive / kestrel

simple, distributed message queue system (inactive)
http://twitter.github.io/kestrel
Other
2.78k stars 313 forks source link

The "handoff an item immediately after disconnecting" fails on some systems #117

Open stass opened 11 years ago

stass commented 11 years ago

Hi!

I have a linux system where the "handoff an item immediately after disconnecting" test fails for some reason. I presume, that's because it is a bit slower, as the same test passes on my FreeBSD laptop, or maybe I'm stepping on some concurrency issue.

I used the following change to make the spec retry the test several times. It solves the issue for me.

diff --git a/src/test/scala/net/lag/kestrel/ServerSpec.scala b/src/test/scala/net/lag/kestrel/ServerSpec.scala
index f794411..2ad82d8 100644
--- a/src/test/scala/net/lag/kestrel/ServerSpec.scala
+++ b/src/test/scala/net/lag/kestrel/ServerSpec.scala
@@ -290,7 +290,7 @@ class ServerSpec extends Specification with TempFolder with TestLogging {
         Thread.sleep(10)

         val getClient2 = new TestClient("localhost", PORT)
-        getClient2.get("slow/open") mustEqual "item"
+        getClient2.get("slow/open") must eventually(be_==("item"))
       }
     }