Another sporadically failing test
The tests (both RUM and non-RUM) are failing very often on CI with this error:
(UndefinedFunctionError) function Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug.call/2 is undefined or private
It's the same error for multiple tests in scheduled_activity_controller_test.exs and filter_controller_test.exs:
- test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs:94
- test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs:13
- test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs:69
- test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs:49
- test/web/mastodon_api/controllers/filter_controller_test.exs:12
- test/web/mastodon_api/controllers/filter_controller_test.exs:117
- test/web/mastodon_api/controllers/filter_controller_test.exs:67
- test/web/mastodon_api/controllers/filter_controller_test.exs:87
- test/web/mastodon_api/controllers/filter_controller_test.exs:33
Example stacktrace:
4) test shows scheduled activities (Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest)
test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs:13
** (UndefinedFunctionError) function Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug.call/2 is undefined or private
code: |> get("/api/v1/scheduled_statuses?limit=2&min_id=#{scheduled_activity_id1}")
stacktrace:
(pleroma) Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug.call(%Plug.Conn{adapter: {Plug.Adapters.Test.Conn, :...}, assigns: %{locale: "en", user: %Pleroma.User{bio: "Tester Number 39", source_data: %{}, notifications: #Ecto.Association.NotLoaded<association :notifications is not loaded>, blocks: [], nickname: "nick39", unread_conversation_count: 0, show_role: true, is_admin: false, locked: false, deactivated: false, hide_followers_count: false, subscribers: [], keys: nil, search_rank: nil, no_rich_text: false, last_digest_emailed_at: ~N[2019-11-19 13:21:29], password_reset_pending: false, follower_count: 0, email_notifications: %{"digest" => false}, discoverable: false, deliveries: #Ecto.Association.NotLoaded<association :deliveries is not loaded>, muted_notifications: [], fields: [], inserted_at: ~N[2019-11-19 13:21:29], domain_blocks: [], name: "Test テスト User 39", tags: [], follower_address: "http://localhost:4001/users/nick39/followers", settings: nil, banner: %{}, is_moderator: false, email: "user39@example.com", avatar: nil, muted_reblogs: [], mutes: [], background: %{}, hide_favorites: true, default_scope: "public", magic_key: nil, __meta__: #Ecto.Schema.Metadata<:loaded, "users">, confirmation_token: nil, last_refreshed_at: nil, search_type: nil, note_count: 0, password_confirmation: nil, ap_enabled: false, ...}}, before_send: [#Function<0.64872641/1 in Plug.Session.before_send/2>, #Function<0.29937896/1 in Pleroma.Web.Endpoint.PipelineInstrumenter.call/2>, #Function<1.112466771/1 in Plug.Logger.call/2>], body_params: %{}, cookies: %{}, halted: false, host: "www.example.com", method: "GET", owner: #PID<0.3840.0>, params: %{"limit" => "2", "min_id" => "4"}, path_info: ["api", "v1", "scheduled_statuses"], path_params: %{}, port: 80, private: %{Pleroma.Web.Router => {[], %{}}, :phoenix_action => :index, :phoenix_controller => Pleroma.Web.MastodonAPI.ScheduledActivityController, :phoenix_endpoint => Pleroma.Web.Endpoint, :phoenix_format => "json", :phoenix_layout => {Pleroma.Web.LayoutView, "app.html"}, :phoenix_recycled => true, :phoenix_router => Pleroma.Web.Router, :phoenix_view => Pleroma.Web.MastodonAPI.ScheduledActivityView, :plug_session => %{"user_id" => "9p7YhcvbNPmab3yVqy"}, :plug_session_fetch => :done, :plug_session_info => :write, :plug_skip_csrf_protection => true}, query_params: %{"limit" => "2", "min_id" => "4"}, query_string: "limit=2&min_id=4", remote_ip: {127, 0, 0, 1}, req_cookies: %{}, req_headers: [], request_path: "/api/v1/scheduled_statuses", resp_body: nil, resp_cookies: %{}, resp_headers: [{"cache-control", "max-age=0, private, must-revalidate"}, {"access-control-allow-origin", "*"}, {"access-control-expose-headers", "Link,X-RateLimit-Reset,X-RateLimit-Limit,X-RateLimit-Remaining,X-Request-Id,Idempotency-Key"}, {"access-control-allow-credentials", "true"}, {"x-xss-protection", "1; mode=block"}, {"x-permitted-cross-domain-policies", "none"}, {"x-frame-options", "DENY"}, {"x-content-type-options", "nosniff"}, {"referrer-policy", "same-origin"}, {"x-download-options", "noopen"}, {"content-security-policy", "default-src 'none'; base-uri 'self'; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; manifest-src 'self'; connect-src 'self' http://localhost:4001 ws://localhost:4001; script-src 'self'; report-uri https://endpoint.com; report-to csp-endpoint;"}, {"reply-to", "{\"endpoints\":[{\"url\":\"https://endpoint.com\"}],\"group\":\"csp-endpoint\",\"max-age\":10886400}"}, {"x-request-id", "FdiS_hOLnmIss8UAAB2V"}], scheme: :http, script_name: [], secret_key_base: :..., state: :unset, status: nil}, [])
(pleroma) lib/pleroma/web/mastodon_api/controllers/scheduled_activity_controller.ex:5: Pleroma.Web.MastodonAPI.ScheduledActivityController.phoenix_controller_pipeline/2
(pleroma) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.instrument/4
(phoenix) lib/phoenix/router.ex:288: Phoenix.Router.__call__/2
(pleroma) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2
(pleroma) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2
(phoenix) lib/phoenix/test/conn_test.ex:235: Phoenix.ConnTest.dispatch/5
test/web/mastodon_api/controllers/scheduled_activity_controller_test.exs:27: (test)