worldcubeassociation.org icon indicating copy to clipboard operation
worldcubeassociation.org copied to clipboard

Resolve intermittent test failures

Open dunkOnIT opened this issue 2 years ago • 2 comments

Some tests in the suite have been known to fail intermittently in the past. Not sure if that is still the case, collecting random failures here in case it is:

Failure from 2nd readme change PR

 1) Competition events management confirmed competition even admin cannot create inconsistent competition state by deleting main event
     Failure/Error: reload

     ActiveRecord::StatementInvalid:
       Mysql2::Error: Table definition has changed, please retry transaction
     # ./app/models/competition.rb:1764:in `set_wcif_events!'
     # ./app/models/competition.rb:1667:in `block in set_wcif!'
     # ./app/models/competition.rb:1665:in `set_wcif!'
     # ./app/controllers/api/v0/competitions_controller.rb:125:in `update_wcif'
     # ./lib/middlewares/warden_user_logger.rb:13:in `call'
     # ./lib/middlewares/fix_accept_header.rb:14:in `call'
     # ------------------
     # --- Caused by: ---
     # Capybara::CapybaraError:
     #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true
     #   /home/runner/work/worldcubeassociation.org/worldcubeassociation.org/WcaOnRails/vendor/bundle/ruby/3.2.0/gems/capybara-3.39.2/lib/capybara/session.rb:163:in `raise_server_error!'

dunkOnIT avatar Sep 20 '23 18:09 dunkOnIT

Failures:

  1. Competition management when signed in as admin change guest entry fee to non-zero Failure/Error: editing_user = User.find(editing_user_id)

    ActiveRecord::RecordNotFound: Couldn't find User with 'id'=1

    ./app/models/competition.rb:781:in `user_cannot_demote_themself'

    ./app/controllers/competitions_controller.rb:393:in `series_eligible_competitions'

    ./lib/middlewares/warden_user_logger.rb:13:in `call'

    ./lib/middlewares/fix_accept_header.rb:14:in `call'

    ------------------

    --- Caused by: ---

    Capybara::CapybaraError:

    Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true

    /home/runner/work/worldcubeassociation.org/worldcubeassociation.org/WcaOnRails/vendor/bundle/ruby/3.2.0/gems/capybara-3.39.2/lib/capybara/session.rb:163:in `raise_server_error!'

  2. Competition management when signed in as admin can change id of short name from admin view Failure/Error: click_button "Update Competition"

    Capybara::ElementNotFound: Unable to find button "Update Competition" that is not disabled

    ./spec/features/competition_management_spec.rb:119:in `block (3 levels) in <top (required)>'

Finished in 12 minutes 58 seconds (files took 15.35 seconds to load) 2797 examples, 2 failures, 2 pending

Failed examples:

rspec ./spec/features/competition_management_spec.rb:138 # Competition management when signed in as admin change guest entry fee to non-zero rspec ./spec/features/competition_management_spec.rb:115 # Competition management when signed in as admin can change id of short name from admin view

Randomized with seed 15046

dunkOnIT avatar Sep 27 '23 05:09 dunkOnIT

  1. JobsCheck finds the oldest job that has been waiting to run Failure/Error: expect(description).to match(/Job #{another_job.cronjob_statistics.id} was/)

    expected "Uh oh! Job WeatMonthlyDigestJob was enqueued 10 minutes ago and still has not run. 1 job is waiting to run." to match /Job ClearConnectedStripeAccount was/ Diff: @@ -1 +1 @@ -/Job ClearConnectedStripeAccount was/ +"Uh oh! Job WeatMonthlyDigestJob was enqueued 10 minutes ago and still has not run. 1 job is waiting to run."

    ./spec/controllers/server_status_controller_spec.rb:57:in `block (2 levels) in <top (required)>'

Finished in 11 minutes 50 seconds (files took 14.28 seconds to load) 2797 examples, 1 failure, 2 pending

Failed examples:

rspec ./spec/controllers/server_status_controller_spec.rb:50 # JobsCheck finds the oldest job that has been waiting to run

Randomized with seed 15764

dunkOnIT avatar Sep 27 '23 05:09 dunkOnIT