Project

General

Profile

Bug #16260

Intermittent DashboardIntegrationTest failures

Added by Dominic Cleal almost 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:

Description

After #16044 was merged, the following test failure was seen on develop:

DashboardIntegrationTest.test_0009_widgets not in dashboard show up in list

ActiveRecord::StatementInvalid: PG::TRDeadlockDetected: ERROR:  deadlock detected
LINE 1: ...STINCT "hosts"."id") FROM "hosts" LEFT OUTER JOIN "host_stat...
                                                             ^
DETAIL:  Process 3578 waits for AccessShareLock on relation 7582348 of database 7582095; blocked by process 21808.
Process 21808 waits for AccessExclusiveLock on relation 7582383 of database 7582095; blocked by process 3578.
HINT:  See server log for query details.
: SELECT COUNT(DISTINCT "hosts"."id") FROM "hosts" LEFT OUTER JOIN "host_status" ON "host_status"."host_id" = "hosts"."id" WHERE "hosts"."type" IN ('Host::Managed', 'Host::Valid') AND (last_report > '2016-08-23 17:11:47.625954') AND (host_status.type = 'HostStatus::ConfigurationStatus') AND ((host_status.status > 0) AND (((host_status.status >> 30 & 63) != 0))) AND "hosts"."enabled" = $1
    app/services/dashboard/data.rb:44:in `fetch_data'
    app/services/dashboard/data.rb:11:in `initialize'
    app/controllers/dashboard_controller.rb:77:in `new'
    app/controllers/dashboard_controller.rb:77:in `prefetch_data'
    app/controllers/concerns/application_shared.rb:14:in `set_timezone'
    app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
    lib/middleware/catch_json_parse_errors.rb:9:in `call'
    lib/middleware/tagged_logging.rb:18:in `call' (ActiveRecord::StatementInvalid)
/usr/local/rvm/gems/ruby-2.1.5@test_develop-1/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:637    

(http://ci.theforeman.org/job/test_develop/2339/)

It appears that dashboard integration tests are not calling wait_for_ajax when visiting the dashboard page, so there are likely more requests still being served at the end of the test causing the deadlock.


Related issues

Related to Foreman - Bug #16044: Errors in individual dashboard widgets fail entire pageClosed2016-08-10

Associated revisions

Revision 1706113e (diff)
Added by Tomer Brisker almost 4 years ago

Fixes #16260 - Wait for dashboard to fully load in test

This will hopefully prevent intermittent db deadlocks.

Revision 407e0f7f (diff)
Added by Dominic Cleal almost 4 years ago

refs #16260 - wait for AJAX on main dashboard page test

History

#1 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #16044: Errors in individual dashboard widgets fail entire page added

#2 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/3771 added

#3 Updated by Anonymous almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by The Foreman Bot almost 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3781 added

#5 Updated by Tomer Brisker almost 4 years ago

  • Target version set to 1.6.2

Also available in: Atom PDF