Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Apr 4, 2024
1 parent 419db47 commit f581161
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/ch/stream_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ defmodule Ch.StreamTest do
test "emits %Ch.Result{}", %{conn: conn} do
count = 1_000_000

assert [%Result{command: :select, data: header} | _rest] =
assert [%Result{command: :select, data: _header} | _rest] =
results =
DBConnection.run(conn, fn conn ->
conn
|> Ch.stream("select * from numbers({count:UInt64})", %{"count" => 1_000_000})
|> Enum.into([])
end)

assert [<<1, 6, "number", 6, "UInt64">> | _] = header
# not always the case
# assert [<<1, 6, "number", 6, "UInt64">> | _] = header

decoded = results |> Enum.map(& &1.data) |> IO.iodata_to_binary() |> RowBinary.decode_rows()

Expand Down

0 comments on commit f581161

Please sign in to comment.