Fix result_pickle_error integration test (#84506)

The test has been updated to use a custom type which does not support pickling,
instead of relying on Jinja's `Undefined` type. As of Jinja 3.1.5 that type now
supports pickle, which breaks the original implementation of the test.
This commit is contained in:
Matt Clay
2025-01-02 19:59:16 -08:00
committed by GitHub
parent f72aa1dc0c
commit 5ec236b564
2 changed files with 7 additions and 3 deletions

View File

@ -5,10 +5,14 @@
from __future__ import annotations
from ansible.plugins.action import ActionBase
from jinja2 import Undefined
class CannotBePickled:
def __getstate__(self):
raise Exception('pickle intentionally not supported')
class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None):
return {'obj': Undefined('obj')}
return {'obj': CannotBePickled()}

View File

@ -8,7 +8,7 @@
- result.msg == expected_msg
- result is failed
vars:
expected_msg: "cannot pickle 'Undefined' object"
expected_msg: "pickle intentionally not supported"
- debug:
msg: Success, no hang