bikebrigade / dispatch

Bike Brigade's dispatching software! 🚴
https://bikebrigade.ca
Apache License 2.0
75 stars 9 forks source link

test flake: BikeBrigade.Locations.LocationTest change_location/2 change postal #398

Closed danp closed 4 months ago

danp commented 4 months ago

Got this as part of #397 but I don't think it's related:

  1) test change_location/2 change postal (BikeBrigade.Locations.LocationTest)
Error:      test/bike_brigade/location_test.exs:90
     match (=) failed
     The following variables were pinned:
       postal = "M6S"
       coords = %Geo.Point{coordinates: {-79.4709465, 43.6387484}, srid: nil, properties: %{}}
     code:  assert {:ok, %{postal: ^postal, coords: ^coords}} =
              Location.change_location(%Location{}, :postal, postal) |> Ecto.Changeset.apply_action(:update)
     left:  {:ok, %{postal: ^postal, coords: ^coords}}
     right: {:ok,
             %BikeBrigade.Locations.Location{
               __meta__: #Ecto.Schema.Metadata<:built, "locations">,
               id: nil,
               coords: nil,
               address: nil,
               city: "Toronto",
               postal: "M6S",
               province: "Ontario",
               country: "Canada",
               unit: nil,
               buzzer: nil,
               location_neighborhood: #Ecto.Association.NotLoaded<association :location_neighborhood is not loaded>,
               neighborhood: #Ecto.Association.NotLoaded<association :neighborhood is not loaded>,
               rider: #Ecto.Association.NotLoaded<association :rider is not loaded>,
               campaign: #Ecto.Association.NotLoaded<association :campaign is not loaded>,
               task_dropoff: #Ecto.Association.NotLoaded<association :task_dropoff is not loaded>,
               task_pickup: #Ecto.Association.NotLoaded<association :task_pickup is not loaded>,
               opportunity: #Ecto.Association.NotLoaded<association :opportunity is not loaded>,
               inserted_at: nil,
               updated_at: nil
             }}
     stacktrace:
       test/bike_brigade/location_test.exs:99: (test)

Looks like it's previously happened as part of main CI, too, such as here.

Would be good to understand why it's flaking and fix.