sasa1977 / con_cache

ets based key/value cache with row level isolated writes and ttl support
MIT License
910 stars 71 forks source link

Unit Test Failure 'test balancer (LockTest)' on Elixir 1.0.0-rc2 #7

Closed holsee closed 10 years ago

holsee commented 10 years ago

$ mix test

17:31:52.946 [error] Error in process <0.133.0> with exit value: {badarg,[{erlang,send,[nil,{'$gen_cast',{lock,<0.133.0>,2}}],[]},{'Elixir.GenServer',do_send,2,[{file,"lib/gen_server.ex"},{line,424}]},{'Elixir.ConCache.Lock',exec,4,[{file,"lib/con_cache/lock.ex"},{line,24}]}]}

17:31:52.947 [error] Error in process <0.136.0> with exit value: {badarg,[{erlang,send,[nil,{'$gen_cast',{lock,<0.136.0>,2}}],[]},{'Elixir.GenServer',do_send,2,[{file,"lib/gen_server.ex"},{line,424}]},{'Elixir.ConCache.Lock',exec,4,[{file,"lib/con_cache/lock.ex"},{line,24}]}]}

17:31:52.947 [error] Error in process <0.139.0> with exit value: {badarg,[{erlang,send,[nil,{'$gen_cast',{lock,<0.139.0>,2}}],[]},{'Elixir.GenServer',do_send,2,[{file,"lib/gen_server.ex"},{line,424}]},{'Elixir.ConCache.Lock',exec,4,[{file,"lib/con_cache/lock.ex"},{line,24}]}]}

1) test balancer (LockTest) test/lock_test.exs:8 Assertion with == failed code: conduct_test({ConCache.BalancedLock, ConCache.BalancedLock.start_link()}) == [{0, 18}, {1, 22}, {2, 15}] lhs: [{0, 18}, {1, 22}] rhs: [{0, 18}, {1, 22}, {2, 15}] stacktrace: test/lock_test.exs:9

...............................

Finished in 5.2 seconds (0.3s on load, 4.9s on tests) 32 tests, 1 failures

Randomized with seed 937703

sasa1977 commented 10 years ago

Thank you for reporting this. This was a subtle bug that somehow creeped in, but strangely enough didn't manifest on my system unless I limit the number of schedulers.

I've pushed the fix to master. Would you mind trying it out from there, and if it works, I can push a patch to hex?

holsee commented 10 years ago

All tests passing, good job :+1:
Just fyi, I was running Processor 1.4 GHz Intel Core i5 on OS X 10.9.4

sasa1977 commented 10 years ago

Thanks again. I pushed v0.5.1 to hex, so you can use the package from there.