diff --git a/changelog/60365.fixed b/changelog/60365.fixed new file mode 100644 index 00000000000..778334ee4b3 --- /dev/null +++ b/changelog/60365.fixed @@ -0,0 +1 @@ +Fixed stdout and stderr being empty sometimes when use_vt=True for the cmd.run[*] functions diff --git a/tests/pytests/integration/modules/test_cmdmod.py b/tests/pytests/integration/modules/test_cmdmod.py index 9775f07618d..4e8ce5824ee 100644 --- a/tests/pytests/integration/modules/test_cmdmod.py +++ b/tests/pytests/integration/modules/test_cmdmod.py @@ -13,3 +13,12 @@ def test_exec_code_all(salt_call_cli, non_root_account): "cmd.exec_code_all", "bash", "echo good", runas=non_root_account.username ) assert ret.returncode == 0 + + +def test_long_stdout(salt_cli, salt_minion): + echo_str = "salt" * 1000 + ret = salt_cli.run( + "cmd.run", f"echo {echo_str}", use_vt=True, minion_tgt=salt_minion.id + ) + assert ret.returncode == 0 + assert len(ret.data.strip()) == len(echo_str)