Skip to content

Commit

Permalink
Fixes two flaky tests (#1836)
Browse files Browse the repository at this point in the history
* flaky test one

* flaky test two

* updated test

* check entire array
  • Loading branch information
anthonyshull authored Dec 20, 2023
1 parent de71c7a commit 73d7ed0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion apps/alerts/test/cache/store_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ defmodule Alerts.Cache.StoreTest do
alert4 = %Alerts.Alert{id: "126", effect: :cancellation}

Store.update([alert1, alert2, alert3, alert4], nil)
assert Store.alert_ids_for_stop_id("543") == ["124", "123"]

assert Enum.sort(Store.alert_ids_for_stop_id("543")) == Enum.sort(["123", "124"])
end
end
5 changes: 2 additions & 3 deletions apps/vehicles/test/repo_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ defmodule Vehicles.RepoTest do

describe "route/1" do
test "given a route ID, finds vehicle statuses for that route", %{name: name} do
expected = Enum.filter(@vehicles, &(&1.route_id == "86"))
refute Enum.empty?(expected)
assert Repo.route("86", name: name) == expected
assert Enum.sort(Enum.filter(@vehicles, &(&1.route_id == "86"))) ==
Enum.sort(Repo.route("86", name: name))
end

test "if there are no vehicles on the route, returns the empty list", %{name: name} do
Expand Down

0 comments on commit 73d7ed0

Please sign in to comment.