Skip to content

Flaky tests

Shen Yang edited this page Dec 18, 2024 · 540 revisions

Suspected Testing Tool Crash

First Seen: Nov 20, 2024
Last Seen: Dec 17, 2024

  1) casa_cases/index is filterable and linkable
     Failure/Error: raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"

     ActionController::RoutingError:
       No route matches [GET] "/users/assets/images/favicon.svg"


     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/actionpack-7.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:35:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/actionpack-7.2.1/lib/action_dispatch/middleware/show_exceptions.rb:32:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/lograge-0.14.0/lib/lograge/rails_ext/rack/logger.rb:18:in `call_app'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/rack/logger.rb:29:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/actionpack-7.2.1/lib/action_dispatch/middleware/remote_ip.rb:96:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/request_store-1.7.0/lib/request_store/middleware.rb:19:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/actionpack-7.2.1/lib/action_dispatch/middleware/request_id.rb:33:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/method_override.rb:24:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/runtime.rb:22:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/actionpack-7.2.1/lib/action_dispatch/middleware/executor.rb:16:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/actionpack-7.2.1/lib/action_dispatch/middleware/static.rb:27:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/sendfile.rb:110:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/rack-cors-2.0.1/lib/rack/cors.rb:102:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/engine.rb:535:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/urlmap.rb:74:in `block in call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/urlmap.rb:58:in `each'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/urlmap.rb:58:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/rack-2.2.9/lib/rack/builder.rb:244:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/capybara-3.40.0/lib/capybara/server/animation_disabler.rb:25:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/capybara-3.40.0/lib/capybara/server/middleware.rb:60:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/puma-6.4.2/lib/puma/configuration.rb:272:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/puma-6.4.2/lib/puma/request.rb:100:in `block in handle_request'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/puma-6.4.2/lib/puma/thread_pool.rb:378:in `with_force_shutdown'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/puma-6.4.2/lib/puma/request.rb:99:in `handle_request'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/puma-6.4.2/lib/puma/server.rb:4[64](https://github.com/rubyforgood/casa/actions/runs/11938626260/job/33277301154?pr=6103#step:9:65):in `process_client'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/puma-6.4.2/lib/puma/server.rb:245:in `block in run'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.2.0/gems/puma-6.4.2/lib/puma/thread_pool.rb:155:in `block in spawn_thread'
     # 
     #   Showing full backtrace because every line was filtered out.
     #   See docs for RSpec::Configuration#backtrace_exclusion_patterns and
     #   RSpec::Configuration#backtrace_inclusion_patterns for more information.
     # ------------------
     # --- Caused by: ---
     # Capybara::ExpectationNotMet:
     #   expected to find link "Cool Volunteer" with href "/volunteers/925/edit" but there were no matches
     #   ./spec/system/casa_cases/index_spec.rb:20:in `block (2 levels) in <top (required)>'

Failed examples:

rspec ./spec/system/casa_cases/index_spec.rb:8 # casa_cases/index is filterable and linkable
1) placements/edit updates placement with valid form data
     Failure/Error: raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"

     ActionController::RoutingError:
       No route matches [GET] "/users/assets/images/favicon.svg"

     [Screenshot Image]: /home/runner/work/casa/casa/tmp/screenshots/failures_r_spec_example_groups_placements_edit_updates_placement_with_valid_form_data_[60](https://github.com/rubyforgood/casa/actions/runs/12327703923/job/34410033510#step:9:61)9.png


     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:35:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2.1/lib/action_dispatch/middleware/show_exceptions.rb:32:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/lograge-0.14.0/lib/lograge/rails_ext/rack/logger.rb:18:in `call_app'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/rack/logger.rb:29:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2.1/lib/action_dispatch/middleware/remote_ip.rb:96:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/request_store-1.7.0/lib/request_store/middleware.rb:19:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2.1/lib/action_dispatch/middleware/request_id.rb:33:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/method_override.rb:28:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/runtime.rb:24:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2.1/lib/action_dispatch/middleware/executor.rb:16:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2.1/lib/action_dispatch/middleware/static.rb:27:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/sendfile.rb:114:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/rack-cors-2.0.2/lib/rack/cors.rb:102:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/engine.rb:535:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/urlmap.rb:76:in `block in call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/urlmap.rb:60:in `each'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/urlmap.rb:60:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/builder.rb:277:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/server/animation_disabler.rb:25:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/server/middleware.rb:60:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/puma-6.5.0/lib/puma/configuration.rb:279:in `call'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/puma-6.5.0/lib/puma/request.rb:99:in `block in handle_request'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/puma-6.5.0/lib/puma/thread_pool.rb:389:in `with_force_shutdown'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/puma-6.5.0/lib/puma/request.rb:98:in `handle_request'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/puma-6.5.0/lib/puma/server.rb:468:in `process_client'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/puma-6.5.0/lib/puma/server.rb:249:in `block in run'
     # /home/runner/work/casa/casa/vendor/bundle/ruby/3.3.0/gems/puma-6.5.0/lib/puma/thread_pool.rb:1[66](https://github.com/rubyforgood/casa/actions/runs/12327703923/job/34410033510#step:9:67):in `block in spawn_thread'
     # 
     #   Showing full backtrace because every line was filtered out.
     #   See docs for RSpec::Configuration#backtrace_exclusion_patterns and
     #   RSpec::Configuration#backtrace_inclusion_patterns for more information.
     # ------------------
     # --- Caused by: ---
     # Capybara::ElementNotFound:
     #   Unable to find link "Edit"
     #   ./spec/system/placements/edit_spec.rb:17:in `block (2 levels) in <top (required)>'

Failed examples:

rspec ./spec/system/placements/edit_spec.rb:20 # placements/edit updates placement with valid form data

Failed to hide banner after dismissing it

First Seen: Nov 20, 2024
Last Seen: Nov 20, 2024

  1) banners/dismiss when user dismisses a banner hides banner
     Failure/Error: expect(page).to have_text("Please fill out this survey")
       expected to find text "Please fill out this survey" in "CasaVolunteerTracking.org\nAbout\nTestimonials\nContact\nLogin\nCasa Volunteer Tracking removes\nthe complexity of managing your\nCASA and tracking your volunteers.\nReady to make yourself more efficient?\nThe Casa Volunteer Tracking app removes the\ncomplexity from your day\nand lets you spend time helping those who need it.\nGet In Touch\nCase Contacts\nVolunteers can record case contacts and learning hours.\nCourt Reports\nVolunteers, supervisors, and admins can generate a court report for any case with all recorded case contacts pre-filled.\nReimbursements\nVolunteers can submit reimbursement requests and admins can generate reports.\nAdd Cases\nSupervisors and administrators can add cases and assign volunteers.\nExportable Data\nAll CASA data is easily exportable in CSV format.\nCommunication\nEasily communicate with volunteers by email, SMS or both.\nTestimonials\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nisl nec aliquam aliquam, nunc nisl aliquam nisl, nec aliquam nisl nunc vel nunc. Sed euismod, nisl nec aliquam aliquam, nunc nisl aliquam nisl, nec aliquam nisl nunc vel nunc. Lorem.\n- Person, Some Casa\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nisl nec aliquam aliquam, nunc nisl aliquam nisl, nec aliquam nisl nunc vel nunc. Sed euismod, nisl nec aliquam aliquam, nunc nisl aliquam nisl, nec aliquam nisl nunc vel nunc.\n- Person, Another Casa\nCASA Organizations Powered by Our App\nWant to use the CASA Volunteer Tracking App?\n\n\nHave questions? Email us at casa@rubyforgood.org\ncasavolunteertracking.org\nThe CASA Volunteer Tracking app was lovingly built by:\nRuby for Good\n\nData illustrations by Storyset"

     # ./spec/system/banners/dismiss_spec.rb:13:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:[100](https://github.com/rubyforgood/casa/actions/runs/11938626329/job/33277315990?pr=6103#step:11:101):in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:82:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:81:in `block (2 levels) in <top (required)>'

rspec ./spec/system/banners/dismiss_spec.rb:9 # banners/dismiss when user dismisses a banner hides banner

Failed to find notifications above the patch notes

First Seen: Nov 20, 2024
Last Seen: Nov 20, 2024

1) notifications/index when there is a deploy date when there are notifications has all notifications created after and including the deploy date above the patch note
     Got 3 failures from failure aggregation block.
     # ./spec/views/notifications/index.html.erb_spec.rb:46:in `block (4 levels) in <top (required)>'
     # ./spec/rails_helper.rb:100:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:82:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:81:in `block (2 levels) in <top (required)>'

     1.1) Failure/Error: expect(notifications_html[0].text).to match(/User \d+ has flagged a Case Contact that needs follow up/)

            expected "\n  \n    \n        \n    \n    \n      \n        Emancipation Checklist Reminder\n        about 1 m...ring our youth for emancipation. Make sure to check the emancipation checklist.\n      \n    \n  \n" to match /User \d+ has flagged a Case Contact that needs follow up/
            Diff:
            @@ -1,15 +1,29 @@
            -/User \d+ has flagged a Case Contact that needs follow up/
            +
            +  
            +    
            +        
            +    
            +    
            +      
            +        Emancipation Checklist Reminder
            +        about 1 month ago
            +      
            +      
            +        Your case CINA-1[62](https://github.com/rubyforgood/casa/actions/runs/11963632007/job/33354425560#step:9:63)9 is a transition aged youth. We want to make sure that along the way, we’re preparing our youth for emancipation. Make sure to check the emancipation checklist.
            +      
            +    
            +  
          # ./spec/views/notifications/index.html.erb_spec.rb:47:in `block (5 levels) in <top (required)>'

     1.2) Failure/Error: expect(notifications_html[1].text).to match(/Your case CINA-\d+ is a transition aged youth/)

            expected "\n  \n    \n        \n    \n    \n      \n        Youth Birthday Notification\n        about 1 month...\n      \n        Your youth, case number: CINA-1[63](https://github.com/rubyforgood/casa/actions/runs/11963632007/job/33354425560#step:9:64)0 has a birthday next month.\n      \n    \n  \n" to match /Your case CINA-\d+ is a transition aged youth/
            Diff:
            @@ -1,15 +1,29 @@
            -/Your case CINA-\d+ is a transition aged youth/
            +
            +  
            +    
            +        
            +    
            +    
            +      
            +        Youth Birthday Notification
            +        about 1 month ago
            +      
            +      
            +        Your youth, case number: CINA-1630 has a birthday next month.
            +      
            +    
            +  
          # ./spec/views/notifications/index.html.erb_spec.rb:48:in `block (5 levels) in <top (required)>'

     1.3) Failure/Error: expect(notifications_html[2].text).to match(/Your youth, case number: CINA-\d+ has a birthday next month/)

            expected "\n  \n    \n        \n    \n    \n      \n        New followup\n        about 1 month ago\n      \n ...up.\nNote: Amet sit quis. Nam est nostrum. Et quod dolorum.\nClick to see more.\n      \n    \n  \n" to match /Your youth, case number: CINA-\d+ has a birthday next month/
            Diff:
            @@ -1,17 +1,33 @@
            -/Your youth, case number: CINA-\d+ has a birthday next month/
            +
            +  
            +    
            +        
            +    
            +    
            +      
            +        New followup
            +        about 1 month ago
            +      
            +      
            +        User 2260 has flagged a Case Contact that needs follow up.
            +Note: Amet sit quis. Nam est nostrum. Et quod dolorum.
            +Click to see more.
            +      
            +    
            +  
          # ./spec/views/notifications/index.html.erb_spec.rb:49:in `block (5 levels) in <top (required)>'
Failed examples:

rspec ./spec/views/notifications/index.html.erb_spec.rb:40 # notifications/index when there is a deploy date when there are notifications has all notifications created after and including the deploy date above the patch note

Too many volunteer emails sent out

First Seen: Nov 26, 2024
Last Seen: Nov 26, 2024

1) Volunteer.email_court_report_reminder sends one mailer
     Failure/Error: VolunteerMailer.court_report_reminder(volunteer, report_due_date)

       (VolunteerMailer (class)).court_report_reminder(#<Volunteer id: 1416, email: "email1679@example.com", created_at: "2024-11-27 02:01:10.818708000 +000...nt_email: false, token: "verysecuretoken", monthly_learning_hours_report: false, date_of_birth: nil>, 2024-12-04 00:00:00.000000000 +0000)
           expected: 0 times with arguments: (#<Volunteer id: 1416, email: "email1675@example.com", created_at: "2024-11-27 02:01:10.799435000 +000...nt_email: false, token: "verysecuretoken", monthly_learning_hours_report: false, date_of_birth: nil>, anything)
           received: 1 time with arguments: (#<Volunteer id: 1416, email: "email1679@example.com", created_at: "2024-11-27 02:01:10.818708000 +000...nt_email: false, token: "verysecuretoken", monthly_learning_hours_report: false, date_of_birth: nil>, 2024-12-04 00:00:00.000000000 +0000)
     # ./app/models/volunteer.rb:76:in `block (2 levels) in send_court_report_reminder'
     # ./app/models/volunteer.rb:72:in `block in send_court_report_reminder'
     # ./app/models/volunteer.rb:71:in `send_court_report_reminder'
     # ./spec/models/volunteer_spec.rb:42:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:100:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:82:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:81:in `block (2 levels) in <top (required)>'

  2) Volunteer.email_court_report_reminder should not send reminders about unassigned cases
     Failure/Error: VolunteerMailer.court_report_reminder(volunteer, report_due_date)

       (VolunteerMailer (class)).court_report_reminder(#<Volunteer id: 1420, email: "email1683@example.com", created_at: "2024-11-27 02:01:10.908[61](https://github.com/rubyforgood/casa/actions/runs/12042310517/job/33575741960#step:9:62)0000 +000...nt_email: false, token: "verysecuretoken", monthly_learning_hours_report: false, date_of_birth: nil>, 2024-12-04 00:00:00.000000000 +0000)
           expected: 0 times with arguments: (#<Volunteer id: 1420, email: "email1687@example.com", created_at: "2024-11-27 02:01:10.932219000 +000...nt_email: false, token: "verysecuretoken", monthly_learning_hours_report: false, date_of_birth: nil>, anything)
           received: 1 time with arguments: (#<Volunteer id: 1420, email: "email1683@example.com", created_at: "2024-11-27 02:01:10.908610000 +000...nt_email: false, token: "verysecuretoken", monthly_learning_hours_report: false, date_of_birth: nil>, 2024-12-04 00:00:00.000000000 +0000)
     # ./app/models/volunteer.rb:76:in `block (2 levels) in send_court_report_reminder'
     # ./app/models/volunteer.rb:72:in `block in send_court_report_reminder'
     # ./app/models/volunteer.rb:71:in `send_court_report_reminder'
     # ./spec/models/volunteer_spec.rb:47:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:100:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:82:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:81:in `block (2 levels) in <top (required)>'

Failed examples:

rspec ./spec/models/volunteer_spec.rb:38 # Volunteer.email_court_report_reminder sends one mailer
rspec ./spec/models/volunteer_spec.rb:45 # Volunteer.email_court_report_reminder should not send reminders about unassigned cases