whatyouhide / xandra

Fast, simple, and robust Cassandra/ScyllaDB driver for Elixir.
ISC License
406 stars 54 forks source link

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

Closed harunzengin closed 1 year ago

harunzengin commented 1 year ago

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)
whatyouhide commented 1 year ago

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