Jira (PUP-10524) Puppet tests fail with facter 4

2 views
Skip to first unread message

Melissa Stone (Jira)

unread,
May 19, 2020, 8:46:04 PM5/19/20
to puppe...@googlegroups.com
Melissa Stone created an issue
 
Puppet / Task PUP-10524
Puppet tests fail with facter 4
Issue Type: Task Task
Assignee: Unassigned
Created: 2020/05/19 5:45 PM
Priority: Normal Normal
Reporter: Melissa Stone

Failures:
 
  1) Puppet::Type::Service::Provider::Openbsd #status should use the status command from the resource
     Failure/Error: if $CHILD_STATUS.exitstatus == 0
     NoMethodError:
       undefined method `exitstatus' for nil:NilClass
     # ./lib/puppet/provider/service/base.rb:74:in `status'
     # ./spec/unit/provider/service/openbsd_spec.rb:61:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
Finished in 29.52 seconds (files took 3.14 seconds to load)
 
  1) Puppet::Node::Facts::Facter resolving file based facts should resolve external facts
     Failure/Error:
       expect do
         expect { apply.run }.to exit_with(0)
       end.to have_printed('bar')
       expected "bar" to be printed; got:
       Warning: Unknown variable: 'foo'. (line: 1, column: 10)
       Error: Evaluation Error: Missing title. The title expression resulted in undef (line: 1, column: 10) on node pyewacket.vpn.puppet.net
     # ./spec/integration/indirector/facts/facter_spec.rb:61:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
Finished in 39.34 seconds (files took 3.6 seconds to load)
 
  1) Puppet::Type::Service::Provider::Redhat when getting all service instances should call service status when initialized from provider
     Failure/Error: if $CHILD_STATUS.exitstatus == 0
     NoMethodError:
       undefined method `exitstatus' for nil:NilClass
     # ./lib/puppet/provider/service/base.rb:74:in `status'
     # ./spec/unit/provider/service/redhat_spec.rb:60:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
  2) Puppet::Type::Service::Provider::Redhat when running status should use any provided explicit command
     Failure/Error: if $CHILD_STATUS.exitstatus == 0
     NoMethodError:
       undefined method `exitstatus' for nil:NilClass
     # ./lib/puppet/provider/service/base.rb:74:in `status'
     # ./spec/unit/provider/service/redhat_spec.rb:122:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
  3) Puppet::Type::Service::Provider::Redhat when running status should execute the service script with status when no explicit command is provided
     Failure/Error: if $CHILD_STATUS.exitstatus == 0
     NoMethodError:
       undefined method `exitstatus' for nil:NilClass
     # ./lib/puppet/provider/service/base.rb:74:in `status'
     # ./spec/unit/provider/service/redhat_spec.rb:128:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
  4) Puppet::Type::Service::Provider::Redhat when checking status when hasstatus is :true should execute the service script with fail_on_failure false
     Failure/Error: if $CHILD_STATUS.exitstatus == 0
     NoMethodError:
       undefined method `exitstatus' for nil:NilClass
     # ./lib/puppet/provider/service/base.rb:74:in `status'
     # ./spec/unit/provider/service/redhat_spec.rb:141:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
  5) Puppet::Type::Service::Provider::Init if the init script is present when running start should use any provided explicit command
     Failure/Error: if type == :start && Facter.value(:osfamily) == "Solaris"
       #<File (class)> received :directory? with unexpected arguments
         expected: ("/alt/service/path")
              got: ("/opt/puppetlabs/facter/cache/cached_facts")
        Please stub a default value first if message might be received with other args as well.
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/cache_manager.rb:13:in `resolve_facts'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/fact_manager.rb:24:in `resolve_facts'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/facter.rb:290:in `resolve_fact'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/facter.rb:221:in `value'
     # ./lib/puppet/provider/service/init.rb:174:in `texecute'
     # ./lib/puppet/provider/service/service.rb:40:in `ucommand'
     # ./lib/puppet/provider/service/base.rb:96:in `start'
     # ./spec/unit/provider/service/init_spec.rb:172:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
  6) Puppet::Type::Service::Provider::Init if the init script is present when running start should pass start to the init script when no explicit command is provided
     Failure/Error: if type == :start && Facter.value(:osfamily) == "Solaris"
       #<File (class)> received :directory? with unexpected arguments
         expected: ("/alt/service/path")
              got: ("/opt/puppetlabs/facter/cache/cached_facts")
        Please stub a default value first if message might be received with other args as well.
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/cache_manager.rb:13:in `resolve_facts'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/fact_manager.rb:24:in `resolve_facts'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/facter.rb:290:in `resolve_fact'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/facter.rb:221:in `value'
     # ./lib/puppet/provider/service/init.rb:174:in `texecute'
     # ./lib/puppet/provider/service/service.rb:40:in `ucommand'
     # ./lib/puppet/provider/service/base.rb:96:in `start'
     # ./spec/unit/provider/service/init_spec.rb:180:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
Finished in 24.21 seconds (files took 3.19 seconds to load)
 
  1) Puppet::Util::Logging when Facter does support trace enables Facter trace when enabled
     Failure/Error: Facter.debugging(level == :debug) if Facter.respond_to? :debugging
       Facter received :trace with unexpected arguments
         expected: (true)
              got: (false)
       Diff:
       @@ -1,2 +1,2 @@
       -[true]
       +[false]
        Please stub a default value first if message might be received with other args as well.
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/options/option_store.rb:124:in `log_level='
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/options/option_store.rb:87:in `debug='
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/options.rb:19:in `[]='
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/facter.rb:106:in `debugging'
     # ./lib/puppet/util/log.rb:114:in `level='
     # ./spec/spec_helper.rb:197:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
  2) Puppet::Resource::Catalog::Compiler after finding nodes when checking for a PE version should add 'pe_serverversion' when PE
     Failure/Error: value = Facter.value(fact)
       #<File (class)> received :readable? with unexpected arguments
         expected: ("/opt/puppetlabs/server/pe_version")
              got: ("/Users/melissa/workdir/puppet/.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/fact_groups.conf")
        Please stub a default value first if message might be received with other args as well.
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/config/fact_groups.rb:13:in `initialize'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/cache_manager.rb:8:in `new'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/cache_manager.rb:8:in `initialize'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/fact_manager.rb:23:in `new'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/framework/core/fact_manager.rb:23:in `resolve_facts'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/facter.rb:290:in `resolve_fact'
     # ./.bundle/gems/ruby/2.6.0/gems/facter-4.0.21/lib/facter.rb:221:in `value'
     # ./lib/puppet/indirector/catalog/compiler.rb:417:in `block in set_server_facts'
     # ./lib/puppet/indirector/catalog/compiler.rb:416:in `each'
     # ./lib/puppet/indirector/catalog/compiler.rb:416:in `set_server_facts'
     # ./lib/puppet/indirector/catalog/compiler.rb:72:in `block in initialize'
     # ./lib/puppet/util/profiler/around_profiler.rb:58:in `profile'
     # ./lib/puppet/util/profiler.rb:51:in `profile'
     # ./lib/puppet/indirector/catalog/compiler.rb:71:in `initialize'
     # ./spec/unit/indirector/catalog/compiler_spec.rb:14:in `new'
     # ./spec/unit/indirector/catalog/compiler_spec.rb:14:in `block (2 levels) in <top (required)>'
     # ./spec/unit/indirector/catalog/compiler_spec.rb:486:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
Finished in 27.56 seconds (files took 2.67 seconds to load)
 
  1) Puppet::Type::Service::Provider::Systemd #status should use the supplied status command if specified
     Failure/Error: if $CHILD_STATUS.exitstatus == 0
     NoMethodError:
       undefined method `exitstatus' for nil:NilClass
     # ./lib/puppet/provider/service/base.rb:74:in `status'
     # ./spec/unit/provider/service/systemd_spec.rb:374:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
Finished in 20.97 seconds (files took 3.02 seconds to load)
 
Finished in 2 minutes 11.8 seconds
25774 examples, 11 failures, 39 pending
 
Failed examples:
rspec ./spec/unit/provider/service/openbsd_spec.rb:57 # Puppet::Type::Service::Provider::Openbsd #status should use the status command from the resource
rspec ./spec/integration/indirector/facts/facter_spec.rb:51 # Puppet::Node::Facts::Facter resolving file based facts should resolve external facts
rspec ./spec/unit/provider/service/redhat_spec.rb:56 # Puppet::Type::Service::Provider::Redhat when getting all service instances should call service status when initialized from provider
rspec './spec/unit/provider/service/redhat_spec.rb[1:15:1]' # Puppet::Type::Service::Provider::Redhat when running status should use any provided explicit command
rspec './spec/unit/provider/service/redhat_spec.rb[1:15:2]' # Puppet::Type::Service::Provider::Redhat when running status should execute the service script with status when no explicit command is provided
rspec ./spec/unit/provider/service/redhat_spec.rb:139 # Puppet::Type::Service::Provider::Redhat when checking status when hasstatus is :true should execute the service script with fail_on_failure false
rspec './spec/unit/provider/service/init_spec.rb[1:4:2:1]' # Puppet::Type::Service::Provider::Init if the init script is present when running start should use any provided explicit command
rspec './spec/unit/provider/service/init_spec.rb[1:4:2:2]' # Puppet::Type::Service::Provider::Init if the init script is present when running start should pass start to the init script when no explicit command is provided
rspec ./spec/unit/util/logging_spec.rb:574 # Puppet::Util::Logging when Facter does support trace enables Facter trace when enabled
rspec ./spec/unit/indirector/catalog/compiler_spec.rb:479 # Puppet::Resource::Catalog::Compiler after finding nodes when checking for a PE version should add 'pe_serverversion' when PE
rspec ./spec/unit/provider/service/systemd_spec.rb:371 # Puppet::Type::Service::Provider::Systemd #status should use the supplied status command if specified

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Melissa Stone (Jira)

unread,
May 19, 2020, 8:58:03 PM5/19/20
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
{code}
Failures:

  1) Puppet::Type::Service::Provider::Openbsd #status should use the status command from the resource
     Failure/Error: if $CHILD_STATUS.exitstatus == 0
     NoMethodError:
       undefined method `exitstatus' for nil:NilClass
     # ./lib/puppet/provider/service/base.rb:74:in `status'
     # ./spec/unit/provider/service/openbsd_spec.rb:61:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
Finished in 29 32 . 52 11 seconds (files took 3.14 seconds to load)


  1) Puppet::Node::Facts::Facter resolving file based facts should resolve external facts
     Failure/Error:
       expect do
         expect { apply.run }.to exit_with(0)
       end.to have_printed('bar')
       expected "bar" to be printed; got:
       Warning: Unknown variable: 'foo'. (line: 1, column: 10)
       Error: Evaluation Error: Missing title. The title expression resulted in undef (line: 1, column: 10) on node pyewacket.vpn.puppet.net
     # ./spec/integration/indirector/facts/facter_spec.rb:61:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block ( 2 levels) in <top (required)>'

     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
Finished in 39 . 34 64 seconds (files took 3.6 seconds to load)
Finished in 24 20 . 21 14 seconds (files took 3 2 . 19 39 seconds to load)
Finished in 27 22 . 56 93 seconds (files took 2. 67 17 seconds to load)


  1) Puppet::Type::Service::Provider::Systemd #status should use the supplied status command if specified
     Failure/Error: if $CHILD_STATUS.exitstatus == 0
     NoMethodError:
       undefined method `exitstatus' for nil:NilClass
     # ./lib/puppet/provider/service/base.rb:74:in `status'
     # ./spec/unit/provider/service/systemd_spec.rb:374:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
Finished in 20 17 . 97 19 seconds (files took 3 2 . 02 44 seconds to load)

Finished in
2 minutes 11 1 minute 43 . 8 31 seconds
25774 examples,
11 8 failures, 39 pending


Failed examples:
rspec ./spec/unit/provider/service/openbsd_spec.rb:57 # Puppet::Type::Service::Provider::Openbsd #status should use the status command from the resource
rspec ./spec/integration/indirector/facts/facter_spec.rb:51 # Puppet::Node::Facts::Facter resolving file based facts should resolve external facts
rspec ./spec/unit/provider/service/redhat_spec.rb:56 # Puppet::Type::Service::Provider::Redhat when getting all service instances should call service status when initialized from provider
rspec './spec/unit/provider/service/redhat_spec.rb[1:15:1]' # Puppet::Type::Service::Provider::Redhat when running status should use any provided explicit command
rspec './spec/unit/provider/service/redhat_spec.rb[1:15:2]' # Puppet::Type::Service::Provider::Redhat when running status should execute the service script with status when no explicit command is provided
rspec ./spec/unit/provider/service/redhat_spec.rb:139 # Puppet::Type::Service::Provider::Redhat when checking status when hasstatus is :true should execute the service script with fail_on_failure false
rspec ' ./spec/unit/ provider/service/init_spec.rb[1:4:2:1]' # Puppet::Type::Service::Provider::Init if the init script is present when running start should use any provided explicit command

rspec './spec/unit/provider/service/init_spec.rb[1:4:2:2]' # Puppet::Type::Service::Provider::Init if the init script is present when running start should pass start to the init script when no explicit command is provided
rspec ./spec/unit/ util/logging_spec.rb:574 # Puppet::Util::Logging when Facter does support trace enables Facter trace when enabled
rspec ./spec/unit/
indirector/catalog/compiler_spec.rb:479 # Puppet::Resource::Catalog::Compiler after finding nodes when checking for a PE version should add 'pe_serverversion' when PE
rspec ./spec/unit/
provider/service/systemd_spec.rb:371 # Puppet::Type::Service::Provider::Systemd #status should use the supplied status command if specified
{code}

Josh Cooper (Jira)

unread,
May 20, 2020, 1:36:04 AM5/20/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-10524
 
Re: Puppet tests fail with facter 4

Bogdan Irimie Melissa and I talked about this today and it looks like previously the tests passed because facter 2.5 executes some process (any successful process will work) prior to some of these tests executing. As a result $CHILD_STATUS is not nil. But when using facter 4 that doesn't happen and it's nil.

One ugly hack is to do what I did for Windows a long time ago:

  if Puppet::Util::Platform.windows?
    # Get a pid for $CHILD_STATUS to latch on to
    command = "cmd.exe /c \"exit 0\""
    Puppet::Util::Execution.execute(command, {:failonfail => false})
  end

Ideally the code should not be using CHILD_STATUS and instead using the ProcessOutput that the Puppet::Util::Execute.execute method returns, but that was looking like a bigger change than expected.

Also there were two failures that seemed to be legit facter differences. Could you or someone on your team take a look as this is a blocker for puppet testing against facter4 in CI? Thanks!

Bogdan Irimie (Jira)

unread,
May 20, 2020, 3:26:03 AM5/20/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
 
Change By: Bogdan Irimie
Sub-team: ghost
Team: Night's Watch

Bogdan Irimie (Jira)

unread,
May 20, 2020, 3:27:03 AM5/20/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Priority: Normal High

Bogdan Irimie (Jira)

unread,
May 21, 2020, 3:14:04 AM5/21/20
to puppe...@googlegroups.com
Bogdan Irimie assigned an issue to Bogdan Irimie
Change By: Bogdan Irimie
Assignee: Bogdan Irimie

Bogdan Irimie (Jira)

unread,
May 21, 2020, 10:55:04 AM5/21/20
to puppe...@googlegroups.com
Bogdan Irimie commented on Task PUP-10524
 
Re: Puppet tests fail with facter 4

Josh Cooper with the fixes from Melissa Stone branch (https://github.com/puppetlabs/puppet/pull/8165/files), Facter 4 master and the fix for $CHILD_STATUS https://github.com/puppetlabs/puppet/pull/8165#issuecomment-632109253 the unit test for puppet pass.

A new version of Facter 4 will be released tomorrow.

Bogdan Irimie (Jira)

unread,
May 22, 2020, 8:48:04 AM5/22/20
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
May 27, 2020, 5:58:03 AM5/27/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
 
Change By: Gheorghe Popescu
Fix Version/s: PUP 6.16.0

Bogdan Irimie (Jira)

unread,
May 29, 2020, 3:47:03 AM5/29/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Fix Version/s: PUP 6.16.0

Gheorghe Popescu (Jira)

unread,
May 29, 2020, 3:59:04 AM5/29/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Fix Version/s: PUP 6.16.0
Reply all
Reply to author
Forward
0 new messages