Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-11048

Ruby 3 freezes CHILD_STATUS, so it can't be stubbed

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 7.7.0
    • None
    • Coremunity
    • Platform Core KANBAN
    • Needs Assessment
    • Enhancement
    • Eliminates the usage of $CHILD_STATUS global variable in builtin service and package providers.
    • Needs Assessment

    Description

      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.

      Attachments

        Activity

          People

            josh Josh Cooper
            josh Josh Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support