Bug #19345

Intermittent ProvisioningTemplatesControllerTest::PXE menu test sort failure

Added by Dominic Cleal about 1 year ago. Updated 6 months ago.

Status:Closed
Priority:Normal
Assigned To:Dominic Cleal
Category:Tests
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4477
Story points-
Velocity based estimate-
Release1.16.0Release relationshipAuto

Description

The following occurred on a branch based on develop (006929d):

ProvisioningTemplatesControllerTest::PXE menu.test_0005_pxe menu's labels should be sorted by full hostgroup title (from ProvisioningTemplatesControllerTest__PXE menu) 

unexpected invocation: #<AnyInstance:ProxyAPI::TFTP>.create_default('PXELinux', {:menu => '\n\n\nDEFAULT menu\nPROMPT 0\nMENU TITLE PXE Menu\nTIMEOUT 200\nTOTALTIMEOUT 6000\nONTIMEOUT local\n\n\nLABEL local\n  MENU LABEL Default local boot\n  MENU DEFAULT\n  LOCALBOOT 0\n\nLABEL local_primary\n  MENU LABEL Default local boot from primary hard drive\n  LOCALBOOT 0x80\n\nLABEL local_skip\n  MENU LABEL Boot from the next BIOS device\n  LOCALBOOT -1\n\nLABEL local_chain_hd0\n  MENU LABEL Chainload the first hard drive (hd0)\n  COM32 chain.c32\n  APPEND hd0\n\nLABEL local_chain_hd1\n  MENU LABEL Chainload the second hard drive (hd1)\n  COM32 chain.c32\n  APPEND hd1\n\n\nLABEL discovery\n  MENU LABEL Foreman Discovery Image\n  KERNEL boot/fdi-image/vmlinuz0\n  APPEND initrd=boot/fdi-image/initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=http://foreman.some.host.fqdn proxy.type=foreman\n  IPAPPEND 2\n\n\n\nLABEL Common - MyString2\n  KERNEL boot/centos-5.3-x86_64-vmlinuz\n  APPEND initrd=boot/centos-5.3-x86_64-initrd.img ks=http://foreman.unattended.url/unattended/template/MyString2/Common ksdevice=bootif network kssendmac ks.sendmac inst.ks.sendmac\n\nLABEL hostgroup10/abc - MyString2\n  KERNEL boot/centos-5.3-x86_64-vmlinuz\n  APPEND initrd=boot/centos-5.3-x86_64-initrd.img ks=http://foreman.unattended.url/unattended/template/MyString2/hostgroup10/abc ksdevice=bootif network kssendmac ks.sendmac inst.ks.sendmac\n\nLABEL hostgroup9/def - MyString2\n  KERNEL boot/centos-5.3-x86_64-vmlinuz\n  APPEND initrd=boot/centos-5.3-x86_64-initrd.img ks=http://foreman.unattended.url/unattended/template/MyString2/hostgroup9/def ksdevice=bootif network kssendmac ks.sendmac inst.ks.sendmac\n\n'})
unsatisfied expectations:
- expected exactly 3 times, invoked once: #<AnyInstance:ProxyAPI::TFTP>.create_default(regexp_matches(/^PXE.*/), has_entry(:menu => regexp_matches(/def.*abc/m)))
satisfied expectations:
- allowed any number of times, not yet invoked: Webpack::Rails::Manifest.asset_paths(any_parameters)
- allowed any number of times, invoked 6 times: #<AnyInstance:ProxyAPI::TFTP>.fetch_boot_file(any_parameters)
 (Minitest::Assertion)
/var/lib/workspace/workspace/test_develop_pr_core/database/mysql/ruby/2.2/slave/fast/app/models/provisioning_template.rb:147    

Seed 13707 with jenkins:unit task.

The test creates two host groups with parents with fixed names, and expects the order of the full names (including parents) to be sorted in a particular way. Because they don't share the same parent, one had the parent name hostgroup9, and the other hostgroup10, reversing the expected sort order as they're sorted alphabetically (hostgroup10, then 9).

Associated revisions

Revision 48c0d613
Added by Dominic Cleal about 1 year ago

fixes #19345 - set host group parent names for consistent sorting

Prevents sequentially generated parent names (e.g. hostgroup9, 10) from
being sorted in the opposite order to the test expectation.

History

#1 Updated by The Foreman Bot about 1 year ago

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

#2 Updated by Dominic Cleal about 1 year ago

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

#3 Updated by Marek Hulán 6 months ago

  • Release set to 1.16.0

Also available in: Atom PDF