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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 7.7.0
    • Component/s: None
    • Labels:
    • Template:
      PUP Bug Template
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Needs Assessment
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      Eliminates the usage of $CHILD_STATUS global variable in builtin service and package providers.
    • QA Risk Assessment:
      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

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

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support