Add second retry in storage test

This commit is contained in:
Jonatan Kłosko 2023-07-24 17:20:14 +02:00
parent 45ad6f0b76
commit 1c98a2a360

View file

@ -107,11 +107,13 @@ defmodule Livebook.StorageTest do
defp read_table_and_lookup(entity) do defp read_table_and_lookup(entity) do
Process.sleep(1) Process.sleep(1)
# :ets.tab2file is asynchronous and may occasionally take
# longer, so we retry
{:ok, tab} = {:ok, tab} =
with {:error, _} <- read_table() do with {:error, _} <- read_table(),
# :ets.tab2file is asynchronous and may occasionally take :ok <- Process.sleep(100),
# longer, so we retry once {:error, _} <- read_table(),
Process.sleep(100) :ok <- Process.sleep(1000) do
read_table() read_table()
end end