     end
 
     test "creates a span", %{pid: pid} do
-      until(fn ->
-        assert {:ok, [{"background_job", nil, [pid: ^pid]}]} = Test.Tracer.get(:create_span)
-      end)
+      assert {:ok, [{"background_job", nil, [pid: ^pid]}]} = Test.Tracer.get(:create_span)
     end
 
     test "adds an error to the created span", %{pid: pid} do
-      until(fn ->
-        assert {:ok, [{%Span{pid: ^pid}, :error, %RuntimeError{message: "Exception"}, stack} | _]} =
-                 Test.Span.get(:add_error)
+      assert {:ok, [{%Span{pid: ^pid}, :error, %RuntimeError{message: "Exception"}, stack} | _]} =
+               Test.Span.get(:add_error)
 
-        assert is_list(stack)
-      end)
+      assert is_list(stack)
     end
 
     test "closes the created span" do
-      until(fn ->
-        assert {:ok, [{%Span{}}]} = Test.Tracer.get(:close_span)
-      end)
+      assert {:ok, [{%Span{}}]} = Test.Tracer.get(:close_span)
     end
   end
 

    end

    test "creates a span", %{pid: pid} do
      until(fn ->
        assert {:ok, [{"background_job", nil, [pid: ^pid]}]} = Test.Tracer.get(:create_span)
      end)
    end

    test "adds an error to the created span", %{pid: pid} do
      until(fn ->
        assert {:ok, [{%Span{pid: ^pid}, :error, %KeyError{}, stack} | _]} =
                 Test.Span.get(:add_error)

        assert is_list(stack)
      end)
    end

    test "closes the created span", %{pid: pid} do
      until(fn ->
        assert {:ok, [{%Span{pid: ^pid}} | _]} = Test.Tracer.get(:close_span)
      end)
    end
  end


    end

    test "adds an error to the existing span", %{span: span} do
      assert {:ok, [{^span, :error, %RuntimeError{message: "Exception"}, _stack} | _]} =
               Test.Span.get(:add_error)
    end

    test "closes the existing span", %{span: span} do
      assert {:ok, [{^span}]} = Test.Tracer.get(:close_span)
    end
  end

