From 95de80f33eff7b565e2cefb117e4492c424f0671 Mon Sep 17 00:00:00 2001
From: Georgy Moshkin <gmoshkin@picodata.io>
Date: Thu, 2 Jun 2022 20:57:02 +0300
Subject: [PATCH] test: add test for graceful stopping

---
 test/int/test_basics.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/int/test_basics.py b/test/int/test_basics.py
index e870f779cd..4ca9e0239b 100644
--- a/test/int/test_basics.py
+++ b/test/int/test_basics.py
@@ -164,3 +164,12 @@ def test_propose_eval(instance: Instance):
 
     assert instance.raft_propose_eval("_G.success = true")
     assert instance.eval("return _G.success") is True
+
+
+def test_graceful_stop(instance: Instance):
+    instance.terminate()
+    *_, last_xlog = sorted(
+        [f for f in os.listdir(instance.data_dir) if f.endswith(".xlog")]
+    )
+    with open(os.path.join(instance.data_dir, last_xlog), "rb") as f:
+        assert f.read()[-4:] == b"\xd5\x10\xad\xed"
-- 
GitLab