Coder Social home page Coder Social logo

alerts_concierge's People

Contributors

alicia-mbta avatar arkadyan avatar bfauble avatar dependabot[bot] avatar dgrosenblatt avatar digitalcora avatar erinlmoore avatar faizaanshamsi avatar katehedgpeth avatar losvedir avatar paulswartz avatar rickypchen avatar ryan-mahoney avatar sabondano avatar uchukwu avatar zfletch avatar zovt avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lund5000

alerts_concierge's Issues

Startup is taking too long

Startup time for the app is 60+ seconds for me.

I suspect there are network calls being made during, and blocking during the supervisor tree startup.

More to follow.

Intermittent test failure for notification_worker_test

This only happened once, but it's worth investigating:

 1) test Worker passes jobs from sending queue to notification (AlertProcessor.NotificationWorkerTest)
     test/alert_processor/dissemination/notification_worker_test.exs:60
     No message matching {:trace, ^pid, :receive, {:sent_notification_email, _}} after 100ms.
     The following variables were pinned:
       pid = #PID<0.2492.0>
     Process mailbox:
       {:trace, #PID<0.2492.0>, :receive, :notification}
       {:trace, #PID<0.2492.0>, :receive, {#Reference<0.2078369325.352845825.37173>, :error}}
       {:trace, #PID<0.2492.0>, :receive, :notification}
       {:trace, #PID<0.2492.0>, :receive, {#Reference<0.2078369325.352845825.49818>, :error}}
     code: assert_receive {:trace, ^pid, :receive, {:sent_notification_email, _}}
     stacktrace:
       test/alert_processor/dissemination/notification_worker_test.exs:71: (test)

Wallaby error during testing

Wallaby fails after ~30 secs of blocking during tests.

** (Mix) Could not start application wallaby: Wallaby.start(:normal, []) returned an error: shutdown: failed to start child: Wallaby.Phantom
    ** (EXIT) shutdown: failed to start child: Wallaby.ServerPool
        ** (EXIT) an exception was raised:
            ** (MatchError) no match of right hand side value: {:error, {:crashed, 1}}
                (poolboy) src/poolboy.erl:275: :poolboy.new_worker/1
                (poolboy) src/poolboy.erl:296: :poolboy.prepopulate/3
                (poolboy) src/poolboy.erl:145: :poolboy.init/3
                (stdlib) gen_server.erl:365: :gen_server.init_it/2
                (stdlib) gen_server.erl:333: :gen_server.init_it/6
                (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
2018-03-07 13:56:30.071 [error] GenServer #PID<0.1077.0> terminating
** (MatchError) no match of right hand side value: {:error, {:crashed, 1}}
    (poolboy) src/poolboy.erl:275: :poolboy.new_worker/1
    (poolboy) src/poolboy.erl:296: :poolboy.prepopulate/3
    (poolboy) src/poolboy.erl:145: :poolboy.init/3
    (stdlib) gen_server.erl:365: :gen_server.init_it/2
    (stdlib) gen_server.erl:333: :gen_server.init_it/6
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.1076.0>, {{:badmatch, {:error, {:crashed, 1}}}, [{:poolboy, :new_worker, 1, [file: 'src/poolboy.erl', line: 275]}, {:poolboy, :prepopulate, 3, [file: 'src/poolboy.erl', line: 296]}, {:poolboy, :init, 3, [file: 'src/poolboy.erl', line: 145]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 365]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 333]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}

AlertProcessor.AlertsClient is receiving non-json response

AlertProcessor.AlertsClient.get_alerts/0 is spamming crash errors because of an invalid JSON response.

The error:

[error] GenServer AlertProcessor.AlertWorker terminating
** (Poison.SyntaxError) Unexpected token: <
    (poison) lib/poison/parser.ex:56: Poison.Parser.parse!/2
    (poison) lib/poison.ex:83: Poison.decode!/2
    (httpoison) lib/httpoison/base.ex:471: HTTPoison.Base.response/6
    (alert_processor) lib/api/alerts_client.ex:13: AlertProcessor.AlertsClient.get_alerts/0
    (alert_processor) lib/alert_parsing/alert_parser.ex:20: AlertProcessor.AlertParser.process_alerts/0
    (alert_processor) lib/alert_parsing/alert_worker.ex:28: AlertProcessor.AlertWorker.handle_info/2
    (stdlib) gen_server.erl:616: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:686: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: :work

mix ecto.setup fails due to rate_limit

Running mix ecto.setup for the first time we get the following error:

[error] Task #PID<0.9909.0> started from AlertProcessor.ServiceInfoCache terminating
** (MatchError) no match of right hand side value: {:error, "rate_limited"}
    (alert_processor) lib/service_info/service_info_cache.ex:409: AlertProcessor.ServiceInfoCache.do_headsigns/2
    (elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Function: &AlertProcessor.ServiceInfoCache.do_headsigns/2
    Args: ["5", 0]
[info] Application alert_processor exited: AlertProcessor.start(:normal, []) returned an error: shutdown: failed to start child: AlertProcessor.ServiceInfoCache
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, "rate_limited"}
            (alert_processor) lib/service_info/service_info_cache.ex:409: AlertProcessor.ServiceInfoCache.do_headsigns/2
            (elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
            (elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
            (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
[info] Application paper_trail exited: :stopped
[info] Application eflame exited: :stopped
[info] Application cowboy exited: :stopped
[info] Application cowlib exited: :stopped
[info] Application ranch exited: :stopped
[info] Application excoveralls exited: :stopped
[info] Application exjsx exited: :stopped
[info] Application dialyxir exited: :stopped
[info] Application dialyzer exited: :stopped
[info] Application wx exited: :stopped
[info] Application hipe exited: :stopped
[info] Application edeliver exited: :stopped
[info] Application scrivener_ecto exited: :stopped
[info] Application scrivener exited: :stopped
[info] Application runtime_tools exited: :stopped
[info] Application httpoison exited: :stopped
[info] Application ex_rated exited: :stopped
[info] Application ex_aws exited: :stopped
[info] Application sweet_xml exited: :stopped
[info] Application xmerl exited: :stopped
[info] Application con_cache exited: :stopped
[info] Application comeonin exited: :stopped
[info] Application calendar exited: :stopped
[info] Application tzdata exited: :stopped
[info] Application hackney exited: :stopped
[info] Application metrics exited: :stopped
[info] Application ssl_verify_fun exited: :stopped
[info] Application certifi exited: :stopped
[info] Application mimerl exited: :stopped
[info] Application idna exited: :stopped

=INFO REPORT==== 7-Mar-2018::13:15:43 ===
    application: logger
    exited: stopped
    type: temporary

=INFO REPORT==== 7-Mar-2018::13:15:43 ===
    application: jsx
    exited: stopped
    type: temporary

=INFO REPORT==== 7-Mar-2018::13:15:43 ===
    application: ex2ms
    exited: stopped
    type: temporary

=INFO REPORT==== 7-Mar-2018::13:15:43 ===
    application: elixir_make
    exited: stopped
    type: temporary
** (Mix) Could not start application alert_processor: AlertProcessor.start(:normal, []) returned an error: shutdown: failed to start child: AlertProcessor.ServiceInfoCache
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, "rate_limited"}
            (alert_processor) lib/service_info/service_info_cache.ex:409: AlertProcessor.ServiceInfoCache.do_headsigns/2
            (elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
            (elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
            (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

In the umbrella app's mix.exs there is an aliases that looks like:

  defp aliases do
    ["ecto.setup": ["ecto.create", "ecto.migrate", "run apps/alert_processor/priv/repo/seeds.exs"],
     "ecto.reset": ["ecto.drop", "ecto.setup"],
     "test.all": ["ecto.create --quiet", "ecto.migrate", "mocha_test", "coveralls.json", "test"]]
  end

Removing the step for running seeds "run apps/alert_processor/priv/repo/seeds.exs" allows the migration command to succeed. However, this is a hack that simply keeps the runtime from starting the apps' supervision trees.

We should fix the issue in AlertProcessor.ServiceInfoCache.

Failing tests on master


  1) test creating a bike storage subscription (ConciergeSite.BikeStorageSubscriptionTest)
     test/feature/bike_storage_subscription_test.exs:11
     ** (Wallaby.QueryError) Expected to find 1, visible text input or textarea 'station' but 0, visible text inputs or textareas were found.

     code: |> fill_in(text_field("station"), with: "Alewife")
     stacktrace:
       (wallaby) lib/wallaby/browser.ex:471: Wallaby.Browser.find/2
       (wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
       test/feature/bike_storage_subscription_test.exs:17: (test)



  2) test creating a parking subscription (ConciergeSite.ParkingSubscriptionTest)
     test/feature/parking_subscription_test.exs:11
     ** (Wallaby.QueryError) Expected to find 1, visible text input or textarea 'station' but 0, visible text inputs or textareas were found.

     code: |> fill_in(text_field("station"), with: "South Station")
     stacktrace:
       (wallaby) lib/wallaby/browser.ex:471: Wallaby.Browser.find/2
       (wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
       test/feature/parking_subscription_test.exs:17: (test)



  3) test editing an accessibility subscription (ConciergeSite.EditSubscriptionTest)
     test/feature/edit_subscription_test.exs:11
     ** (Wallaby.QueryError) The text 'station' matched a label but the label's 'for' attribute
     doesn't match the id of any element.

     Make sure that id on your element is `id="station"`.

     code: |> create_subscription
     stacktrace:
       (wallaby) lib/wallaby/browser.ex:473: Wallaby.Browser.find/2
       (wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
       test/feature/edit_subscription_test.exs:45: ConciergeSite.EditSubscriptionTest.create_subscription/2
       test/feature/edit_subscription_test.exs:16: (test)



  4) test creating an accessibility subscription (ConciergeSite.AccessibilitySubscriptionTest)
     test/feature/accessibility_subscription_test.exs:11
     ** (Wallaby.QueryError) The text 'station' matched a label but the label's 'for' attribute
     doesn't match the id of any element.

     Make sure that id on your element is `id="station"`.

     code: |> fill_in(text_field("station"), with: "Central")
     stacktrace:
       (wallaby) lib/wallaby/browser.ex:473: Wallaby.Browser.find/2
       (wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
       test/feature/accessibility_subscription_test.exs:18: (test)

....2018-03-12 13:29:22.537 [error] GenServer AlertProcessor.AlertWorker terminating
** (FunctionClauseError) no function clause matching in AlertProcessor.AlertWorker.handle_info/2
    (alert_processor) lib/alert_parsing/alert_worker.ex:27: AlertProcessor.AlertWorker.handle_info(:processed_alerts, nil)
    (stdlib) gen_server.erl:616: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:686: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: :processed_alerts
.

  5) test deleting a subscription (ConciergeSite.EditSubscriptionTest)
     test/feature/edit_subscription_test.exs:25
     ** (Wallaby.QueryError) The text 'station' matched a label but the label's 'for' attribute
     doesn't match the id of any element.

     Make sure that id on your element is `id="station"`.

     code: |> create_subscription("Weekdays")
     stacktrace:
       (wallaby) lib/wallaby/browser.ex:473: Wallaby.Browser.find/2
       (wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
       test/feature/edit_subscription_test.exs:45: ConciergeSite.EditSubscriptionTest.create_subscription/2
       test/feature/edit_subscription_test.exs:30: (test)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.