Skip to content

Commit

Permalink
Guard tests that rely on new API
Browse files Browse the repository at this point in the history
Signed-off-by: Cole Miller <[email protected]>
  • Loading branch information
cole-miller committed Aug 26, 2024
1 parent 642ad9a commit 057725e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/integration/test_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ TEST(cluster, dataOnNewNode, setUp, tearDown, 0, cluster_params)
strtol(munit_parameters_get(params, "num_records"), NULL, 0);
unsigned id = 2;
const char *address = "@2";
int rv;

HANDSHAKE;
OPEN;
Expand All @@ -160,6 +159,8 @@ TEST(cluster, dataOnNewNode, setUp, tearDown, 0, cluster_params)
struct test_server *first = &f->servers[0];
test_server_stop(first);
test_server_prepare(first, params);
#ifndef USE_SYSTEM_RAFT
int rv;
/* One entry per INSERT, plus one for the initial configuration, plus
* one for the CREATE TABLE, plus one legacy checkpoint command entry
* after 993 records or two after 2200 records. */
Expand All @@ -178,6 +179,7 @@ TEST(cluster, dataOnNewNode, setUp, tearDown, 0, cluster_params)
munit_assert_uint64(expected_entries, <=, last_entry_index);
munit_assert_uint64(last_entry_index, <, expected_entries + max_barriers);
munit_assert_uint64(last_entry_term, ==, 1);
#endif
test_server_run(first);

/* The full table is visible from the new node */
Expand All @@ -197,13 +199,15 @@ TEST(cluster, dataOnNewNode, setUp, tearDown, 0, cluster_params)
struct test_server *second = &f->servers[1];
test_server_stop(second);
test_server_prepare(second, params);
#ifndef USE_SYSTEM_RAFT
rv = dqlite_node_describe_last_entry(second->dqlite,
&last_entry_index,
&last_entry_term);
munit_assert_int(rv, ==, 0);
munit_assert_uint64(expected_entries + 1, <=, last_entry_index);
munit_assert_uint64(last_entry_index, <, expected_entries + max_barriers + 1);
munit_assert_uint64(last_entry_term, ==, 1);
#endif
test_server_run(second);
return MUNIT_OK;
}
Expand Down Expand Up @@ -328,6 +332,8 @@ TEST(cluster, modifyingQuerySql, setUp, tearDown, 0, cluster_params)
return MUNIT_OK;
}

#ifndef USE_SYSTEM_RAFT

/* Edge cases for dqlite_node_describe_last_entry. */
TEST(cluster, last_entry_edge_cases, setUp, tearDown, 0, NULL)
{
Expand Down Expand Up @@ -362,3 +368,5 @@ TEST(cluster, last_entry_edge_cases, setUp, tearDown, 0, NULL)

return MUNIT_OK;
}

#endif

0 comments on commit 057725e

Please sign in to comment.