Skip to content

Commit

Permalink
etcdctl txn needs two trailing newlines on stdin
Browse files Browse the repository at this point in the history
and make sure to check the returncode
  • Loading branch information
minrk committed Mar 6, 2023
1 parent b4f9780 commit 174be9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 174be9a

Please sign in to comment.