Project

General

Profile

Bug #19344

Intermittent test failure in "UsergroupTest.test_0003_hosts should be retrieved from recursive/complex usergroup definitions"

Added by Dominic Cleal over 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

The following test failure occurred on develop (at 006929d):

UsergroupTest.test_0003_hosts should be retrieved from recursive/complex usergroup definitions

--- expected
+++ actual
@@ -1 +1 @@
-[#<Host::Managed id: 6, name: "host10", last_compile: nil, last_report: nil, updated_at: "2017-04-21 10:11:34", created_at: "2017-04-21 10:11:34", root_pass: "$5$8ss8vcIg$TaIAHUsKlz5MhOxbtockec0ObXlnFyxQegAfpE...", architecture_id: nil, operatingsystem_id: nil, environment_id: nil, ptable_id: nil, medium_id: nil, build: false, comment: nil, disk: nil, installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 980190972, owner_type: "User", enabled: true, puppet_ca_proxy_id: nil, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: 447626438, location_id: 255093256, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: nil, grub_pass: "$1$icti7NPx$Fe7rlkXozpoAuKovKsMzL/", global_status: 0, lookup_value_matcher: "fqdn=host10", pxe_loader: nil>, #<Host::Managed id: 3, name: "host7", last_compile: nil, last_report: nil, updated_at: "2017-04-21 10:11:34", created_at: "2017-04-21 10:11:34", root_pass: "$5$0dUPENns$99bB.APaogncUpgqx7qAhVf0tilukXqoQSVfIn...", architecture_id: nil, operatingsystem_id: nil, environment_id: nil, ptable_id: nil, medium_id: nil, build: false, comment: nil, disk: nil, installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 14, owner_type: "Usergroup", enabled: true, puppet_ca_proxy_id: nil, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: 447626438, location_id: 255093256, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: nil, grub_pass: "$1$aeVH7TLm$3KNTsWuQzLozEUlaDVnb/.", global_status: 0, lookup_value_matcher: "fqdn=host7", pxe_loader: nil>]
+[#<Host::Managed id: 3, name: "host7", last_compile: nil, last_report: nil, updated_at: "2017-04-21 10:11:34", created_at: "2017-04-21 10:11:34", root_pass: "$5$0dUPENns$99bB.APaogncUpgqx7qAhVf0tilukXqoQSVfIn...", architecture_id: nil, operatingsystem_id: nil, environment_id: nil, ptable_id: nil, medium_id: nil, build: false, comment: nil, disk: nil, installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 14, owner_type: "Usergroup", enabled: true, puppet_ca_proxy_id: nil, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: 447626438, location_id: 255093256, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: nil, grub_pass: "$1$aeVH7TLm$3KNTsWuQzLozEUlaDVnb/.", global_status: 0, lookup_value_matcher: "fqdn=host7", pxe_loader: nil>, #<Host::Managed id: 6, name: "host10", last_compile: nil, last_report: nil, updated_at: "2017-04-21 10:11:34", created_at: "2017-04-21 10:11:34", root_pass: "$5$8ss8vcIg$TaIAHUsKlz5MhOxbtockec0ObXlnFyxQegAfpE...", architecture_id: nil, operatingsystem_id: nil, environment_id: nil, ptable_id: nil, medium_id: nil, build: false, comment: nil, disk: nil, installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 980190972, owner_type: "User", enabled: true, puppet_ca_proxy_id: nil, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: 447626438, location_id: 255093256, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: nil, grub_pass: "$1$icti7NPx$Fe7rlkXozpoAuKovKsMzL/", global_status: 0, lookup_value_matcher: "fqdn=host10", pxe_loader: nil>]
 (Minitest::Assertion)
/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/2.4/slave/fast/test/models/usergroup_test.rb:64

The test appears to be expecting a different order in the returned results.

The test sorts the returned result, but Host::Managed#<=> implements sorting by name (i.e. host10, host7), rather than ID. The expected order is by ID.

Associated revisions

Revision b8deed3d (diff)
Added by Dominic Cleal over 1 year ago

fixes #19344 - sort both expected and actual results in UG test

Sorting of the actual value is by name (`Host::Managed#<=>`), but the
expected value was sorted by ID (order of creation). Expected/actual
arguments are swapped to correct order.

History

#1 Updated by Dominic Cleal over 1 year ago

Minitest seed was 19982, using tasks jenkins:unit jenkins:integration.

#2 Updated by The Foreman Bot over 1 year ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4476 added

#3 Updated by Dominic Cleal over 1 year ago

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

#4 Updated by Marek Hulán about 1 year ago

  • Legacy Backlogs Release (now unused) set to 240

Also available in: Atom PDF