Jira (PUP-11048) Ruby 3 freezes CHILD_STATUS, so it can't be stubbed

114 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Apr 29, 2021, 6:58:02 PM4/29/21
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Bug PUP-11048
Ruby 3 freezes CHILD_STATUS, so it can't be stubbed
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/04/29 3:57 PM
Priority: Normal Normal
Reporter: Josh Cooper

Some of our provider tests add expectations to $CHILD_STATUS#exitstatus, but that is no longer possible in Ruby 3, because it is frozen, leading to:

       Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations.

Now that Puppet::Util::Execution.execute returns a ProcessOutput containing the exitstatus, there is no reason to continue using CHILD_STATUS.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 29, 2021, 6:58:04 PM4/29/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 29, 2021, 7:33:03 PM4/29/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core KANBAN

Josh Cooper (Jira)

unread,
Apr 29, 2021, 7:33:04 PM4/29/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 12, 2021, 1:22:06 PM5/12/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 12, 2021, 1:22:07 PM5/12/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Not Needed

Josh Cooper (Jira)

unread,
May 12, 2021, 1:26:02 PM5/12/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Not Needed Enhancement
Release Notes Summary: Eliminates the usage of $CHILD_STATUS global variable in builtin service and package providers.

Josh Cooper (Jira)

unread,
May 12, 2021, 1:26:02 PM5/12/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.7.0

Josh Cooper (Jira)

unread,
May 12, 2021, 7:27:02 PM5/12/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11048
 
Re: Ruby 3 freezes CHILD_STATUS, so it can't be stubbed

Running the following on Ubuntu 18.04 fails:

# puppet resource service asdf ensure=false enable=false
Error: /Service[asdf]: Could not evaluate: wrong number of arguments (given 5, expected 1..2)
Error: Could not run: wrong number of arguments (given 5, expected 1..2)

Josh Cooper (Jira)

unread,
May 13, 2021, 3:38:03 PM5/13/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11048

Follow up PR merged to main and passed CI in 93c86d6dc8

Claire Cadman (Jira)

unread,
May 18, 2021, 9:55:01 AM5/18/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages