whatyouhide/xandra

Test: handles status change events (Xandra.ClusterTest) is flaky

Closed this issue · 1 comments

While running the tests locally, I noticed that sometimes tests fail with:

  1) test handles status change events (Xandra.ClusterTest)
     test/integration/cluster_test.exs:140
     match (=) failed
     The following variables were pinned:
       peername1 = {{199, 0, 0, 1}, 9042}
     code:  assert [{^peername1, :undefined, :worker, _}] = Supervisor.which_children(pool_sup)
     left:  [{^peername1, :undefined, :worker, _}]
     right: [{{{199, 0, 0, 2}, 9042}, #PID<0.1073.0>, :worker, [Xandra.ClusterTest.PoolMock]}, {{{199, 0, 0, 1}, 9042}, :undefined, :worker, [Xandra.ClusterTest.PoolMock]}]
     stacktrace:
       test/integration/cluster_test.exs:173: (test)

Good catch @harunzengin! It never happened to me locally, but I can see why it does happen. I fixed it in the commit above ✅