Jira (PUP-11656) Investigate systemd rspec test failure and update tests

12 views
Skip to first unread message

Aria Li (Jira)

unread,
Oct 14, 2022, 5:38:02 PM10/14/22
to puppe...@googlegroups.com
Aria Li created an issue
 
Puppet / Task PUP-11656
Investigate systemd rspec test failure and update tests
Issue Type: Task Task
Assignee: Unassigned
Created: 2022/10/14 2:37 PM
Priority: Normal Normal
Reporter: Aria Li

The failure is caused by the ./spec/unit/provider/service/systemd_spec.rb test in puppet (specifically line 334).

The failure seems to be related to the platform the tests are run on, they show up on Mac machines but not on Linux based machines. It does not seem to be related to the Ruby version since the failure popped up on both Ruby 2.7.3 and 3.1.2.

Output from systemd_spec.rb test (for both Ruby 3.1.2 & 2.7.3) on macOS 12.6:

❯ bundle exec rspec ./spec/unit/provider/service/systemd_spec.rb:334
Failures:
 
  1) Puppet::Type::Service::Provider::Systemd #enabled? should consider nonexistent services to be disabled
     Failure/Error:
       expect(provider).to receive(:execute).with(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], :failonfail => false)
                             .and_return(Puppet::Util::Execution::ProcessOutput.new("", 1))
 
       (Service[doesnotexist](provider=systemd)).execute(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail=>false})
           expected: 1 time with arguments: (["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail=>false})
           received: 0 times
     # ./spec/unit/provider/service/systemd_spec.rb:338:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # ./.bundle/ruby/3.1.0/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'
 
Finished in 1.55 seconds (files took 1.87 seconds to load)
1 example, 1 failure
 
Failed examples:
 
rspec ./spec/unit/provider/service/systemd_spec.rb:334 # Puppet::Type::Service::Provider::Systemd #enabled? should consider nonexistent services to be disabled

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Aria Li (Jira)

unread,
Oct 14, 2022, 5:39:03 PM10/14/22
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
The failure is caused by the ./spec/unit/provider/service/systemd_spec.rb test in puppet (specifically line 334).

The failure seems to be related to the platform the tests are run on, they show up on Mac machines but not on Linux based machines. It does not seem to be related to the Ruby version since the failure popped up on both Ruby 2.7.3 and 3.1.2.

* Output from systemd_spec.rb test (for both Ruby 3.1.2 & 2.7.3) on macOS 12.6: *
{code:java}

❯ bundle exec rspec ./spec/unit/provider/service/systemd_spec.rb:334
Failures:

  1) Puppet::Type::Service::Provider::Systemd #enabled? should consider nonexistent services to be disabled
     Failure/Error:
       expect(provider).to receive(:execute).with(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], :failonfail => false)
                     .and_return(Puppet::Util::Execution::ProcessOutput.new("", 1))

       (Service[doesnotexist](provider=systemd)).execute(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail=>false})
           expected: 1 time with arguments: (["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail=>false})
           received: 0 times
     # ./spec/unit/provider/service/systemd_spec.rb:338:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # ./.bundle/ruby/3.1.0/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

Finished in 1.55 seconds (files took 1.87 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/unit/provider/service/systemd_spec.rb:334 # Puppet::Type::Service::Provider::Systemd #enabled? should consider nonexistent services to be disabled
{code}

Aria Li (Jira)

unread,
Oct 14, 2022, 5:41:01 PM10/14/22
to puppe...@googlegroups.com
Aria Li updated an issue
The failure is caused by the ./spec/unit/provider/service/systemd_spec.rb test in puppet (specifically line 334).

The failure seems to be related to the platform the tests are run on, they show up on Mac machines but not on Linux Ubuntu based machines. It does not seem to be related to the Ruby version since the failure popped up on both Ruby 2.7.3 and 3.1.2.

*Output from systemd_spec.rb test (for both Ruby 3.1.2 & 2.7.3) on macOS 12.6:*

{code:java}
❯ bundle exec rspec ./spec/unit/provider/service/systemd_spec.rb:334
Failures:

  1) Puppet::Type::Service::Provider::Systemd #enabled? should consider nonexistent services to be disabled
     Failure/Error:
       expect(provider).to receive(:execute).with(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], :failonfail => false)
                     .and_return(Puppet::Util::Execution::ProcessOutput.new("", 1))

       (Service[doesnotexist](provider=systemd)).execute(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail=>false})
           expected: 1 time with arguments: (["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail=>false})
           received: 0 times
     # ./spec/unit/provider/service/systemd_spec.rb:338:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # ./.bundle/ruby/3.1.0/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

Finished in 1.55 seconds (files took 1.87 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/unit/provider/service/systemd_spec.rb:334 # Puppet::Type::Service::Provider::Systemd #enabled? should consider nonexistent services to be disabled
{code}

Aria Li (Jira)

unread,
Oct 14, 2022, 5:41:02 PM10/14/22
to puppe...@googlegroups.com
Aria Li updated an issue
The failure is caused by the ./spec/unit/provider/service/systemd_spec.rb test in puppet (specifically line 334).

The failure seems to be related to the platform the tests are run on, they show up on Mac machines but not on Ubuntu based machines. It does not seem to be related to the Ruby version since the failure popped up on both Ruby 2.7.3 and 3.1.2.


*Output from systemd_spec.rb test (for both Ruby 3.1.2 & 2.7.3) on macOS 12.6:*
{code:java}
❯ bundle exec rspec ./spec/unit/provider/service/systemd_spec.rb:334
Failures:

  1) Puppet::Type::Service::Provider::Systemd #enabled? should consider nonexistent services to be disabled
     Failure/Error:
       expect(provider).to receive(:execute).with(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], :failonfail => false)
                     .and_return(Puppet::Util::Execution::ProcessOutput.new("", 1))

       (Service[doesnotexist](provider=systemd)).execute(["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail=>false})
           expected: 1 time with arguments: (["/usr/sbin/invoke-rc.d", "--quiet", "--query", "doesnotexist", "start"], {:failonfail=>false})
           received: 0 times
     # ./spec/unit/provider/service/systemd_spec.rb:338:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
     # ./.bundle/ruby/3.1.0/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

Finished in 1.55 seconds (files took 1.87 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/unit/provider/service/systemd_spec.rb:334 # Puppet::Type::Service::Provider::Systemd #enabled? should consider nonexistent services to be disabled
{code}

Morgan Rhodes (Jira)

unread,
Oct 18, 2022, 4:07:03 PM10/18/22
to puppe...@googlegroups.com

David Piekny (Jira)

unread,
Oct 20, 2022, 1:29:03 PM10/20/22
to puppe...@googlegroups.com
David Piekny updated an issue
Change By: David Piekny
Epic Link: PUP- 11619 11658
Reply all
Reply to author
Forward
0 new messages