Skip to content
Snippets Groups Projects
Commit 79408f6e authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

test: use .proc_runtime_info in tests

parent e6aaa459
No related branches found
No related tags found
1 merge request!840Info proc API
Pipeline #31731 failed
...@@ -275,31 +275,6 @@ pub(crate) fn setup(args: &args::Run) { ...@@ -275,31 +275,6 @@ pub(crate) fn setup(args: &args::Run) {
tlua::function0(|| traft::node::global().map(|n| n.status())), tlua::function0(|| traft::node::global().map(|n| n.status())),
); );
///////////////////////////////////////////////////////////////////////////
// FIXME: too many statuses
luamod_set(
&l,
"_governor_loop_status",
indoc! {"
pico._governor_loop_status()
==================
Returns the governor loop status.
Returns:
(string)
or
(nil, string) in case of an error, if the raft node is
not initialized yet
"},
tlua::Function::new(|| -> traft::Result<&'static str> {
let node = traft::node::global()?;
Ok(node.governor_loop.status.get().governor_loop_status)
}),
);
luamod_set( luamod_set(
&l, &l,
"raft_tick", "raft_tick",
......
...@@ -195,7 +195,7 @@ def wait_governor_status(i: Instance, expected_status, timeout=5): ...@@ -195,7 +195,7 @@ def wait_governor_status(i: Instance, expected_status, timeout=5):
pass pass
def impl(): def impl():
actual_status = i.call("pico._governor_loop_status") actual_status = i.call(".proc_runtime_info")["internal"]["governor_loop_status"]
if actual_status == "not a leader": if actual_status == "not a leader":
raise NotALeader("not a leader") raise NotALeader("not a leader")
......
...@@ -212,7 +212,8 @@ def test_large_snapshot(cluster: Cluster): ...@@ -212,7 +212,8 @@ def test_large_snapshot(cluster: Cluster):
# Wait for i4 to start receiving the snapshot # Wait for i4 to start receiving the snapshot
Retriable(10, 60).call( Retriable(10, 60).call(
lambda: assert_eq( lambda: assert_eq(
i4.eval("return pico.raft_status().main_loop_status"), "receiving snapshot" i4.call(".proc_runtime_info")["internal"]["main_loop_status"],
"receiving snapshot",
) )
) )
...@@ -230,7 +231,8 @@ def test_large_snapshot(cluster: Cluster): ...@@ -230,7 +231,8 @@ def test_large_snapshot(cluster: Cluster):
# Wait for i5 to start receiving the snapshot # Wait for i5 to start receiving the snapshot
Retriable(10, 60).call( Retriable(10, 60).call(
lambda: assert_eq( lambda: assert_eq(
i5.eval("return pico.raft_status().main_loop_status"), "receiving snapshot" i5.call(".proc_runtime_info")["internal"]["main_loop_status"],
"receiving snapshot",
) )
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment