From 174be9a882be7fef786f38697010f7fc99987320 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 6 Mar 2023 08:26:11 +0100 Subject: [PATCH] etcdctl txn needs two trailing newlines on stdin and make sure to check the returncode --- tests/conftest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1c012ac0..76b38054 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -393,8 +393,12 @@ def _config_etcd(*extra_args): proc = subprocess.Popen( data_store_cmd, stdin=subprocess.PIPE, env=Config.etcdctl_env ) - proc.communicate(txns.encode()) + # need two trailing newlines for etcdctl txn to complete + proc.communicate(txns.encode() + b'\n\n') proc.wait() + assert ( + proc.returncode == 0 + ), f"{data_store_cmd} exited with status {proc.returncode}" @pytest.fixture