forked from lei.chen/myxce
fix(controller-tests): make Unity test-file attribution and counters consistent suite-wide
Only 21 of 86 test_*.c group functions called their own nested UNITY_BEGIN()/UNITY_END(). Each nested call reset Unity's global NumberOfTests/TestFailures counters, so controller_test.c's final `return UNITY_END();` -- the value meson test actually gates on -- only ever reflected whichever small window of tests ran since the LAST nested reset, silently discarding pass/fail evidence for everything before it (measured: 16 of 972 total tests in one run). The same nested-BEGIN calls also caused PASS/FAIL banners to show the wrong source file for tests in files that don't reset it themselves (Unity.TestFile just carries over from whichever group last called UNITY_BEGIN()). Fix: replace every nested UNITY_BEGIN() with UnitySetTestFile(__FILE__) (sets file attribution only, no counter reset) and drop the matching UNITY_END(); add the same UnitySetTestFile(__FILE__) as the first statement to the other group functions that had neither. The 2 genuinely standalone binaries (test_job_array_sched_push.c, test_job_array_apiserver_push.c -- each has its own int main(), not registered via controller_test.c's TEST() macro) are untouched. Verified: single consolidated summary now reads "972 Tests 0 Failures 0 Ignored OK", exactly matching the ground-truth RUN_TEST call-site count across all 83 registered group files (976 total minus 4 belonging to the 2 standalone binaries). Every PASS/FAIL banner now names its own true source file. Full xce-build.sh all regression pass clean (Ok: 9, Fail: 0). No production code touched -- test-harness plumbing only.
This commit is contained in:
parent
e6956ecf46
commit
a81f2a249c
83 changed files with 83 additions and 38 deletions
|
|
@ -741,7 +741,7 @@ static void test_ace_null_persist_returns_error(void)
|
|||
|
||||
void test_apply_committed_entry(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_ace_job_submit_constructs_and_notifies);
|
||||
RUN_TEST(test_ace_job_submit_duplicate_is_noop_no_extra_notify);
|
||||
RUN_TEST(test_ace_job_state_transition_applies_forward_and_notifies);
|
||||
|
|
@ -755,5 +755,4 @@ void test_apply_committed_entry(void)
|
|||
RUN_TEST(test_ace_job_array_submit_bulk_insert_failure_fires_hook_for_prefix);
|
||||
#endif
|
||||
RUN_TEST(test_ace_null_persist_returns_error);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1496,6 +1496,7 @@ static void test_apply_divergent_fence_does_not_survive_a_clean_restart(void)
|
|||
|
||||
void test_apply_correctness_verification(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_clean_replay_produces_apply_clean_alongside_crc_verdict);
|
||||
RUN_TEST(test_checkpoint_tail_with_no_snapshot_is_apply_clean);
|
||||
RUN_TEST(test_verify_apply_correctness_detects_job_count_mismatch);
|
||||
|
|
|
|||
|
|
@ -1639,7 +1639,7 @@ static void test_standby_truncate_before_commit_leaves_no_phantom_job(void)
|
|||
|
||||
void test_apply_pump(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_apply_pump_kick_applies_committed_burst_in_ascending_lsn_order);
|
||||
RUN_TEST(test_apply_pump_run_applies_mixed_submit_and_fact_entries);
|
||||
RUN_TEST(test_apply_pump_run_halts_at_failed_lsn_without_advancing);
|
||||
|
|
@ -1650,5 +1650,4 @@ void test_apply_pump(void)
|
|||
RUN_TEST(test_apply_pump_late_pending_apply_registration_self_heals);
|
||||
RUN_TEST(test_standby_apply_deferred_until_committed_then_materializes);
|
||||
RUN_TEST(test_standby_truncate_before_commit_leaves_no_phantom_job);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1353,11 +1353,10 @@ static void test_pump_burst_catchup_real_pool_no_hang_no_double_fire(void)
|
|||
|
||||
void test_apply_pump_integration(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_pump_command_and_fact_interleave_through_same_commit);
|
||||
RUN_TEST(
|
||||
test_pump_fact_reactions_withheld_during_outage_then_fire_after_restore);
|
||||
RUN_TEST(test_pump_mixed_facts_and_commands_catchup_original_order);
|
||||
RUN_TEST(test_pump_burst_catchup_real_pool_no_hang_no_double_fire);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -374,10 +374,9 @@ test_tari_finish_then_stale_start_preserves_terminal_state_via_dispatch(void)
|
|||
|
||||
void test_apply_reapply_idempotency(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_tari_job_submit_reapplied_thrice_is_idempotent);
|
||||
RUN_TEST(test_tari_job_state_transition_reapplied_identical_is_idempotent);
|
||||
RUN_TEST(
|
||||
test_tari_finish_then_stale_start_preserves_terminal_state_via_dispatch);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ static void test_apply_fail_transition_merges_perr_on_terminal(void)
|
|||
|
||||
void test_apply_seam(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_apply_start_transition_applies_forward);
|
||||
RUN_TEST(test_apply_start_transition_rejects_backward_on_terminal);
|
||||
RUN_TEST(test_apply_finish_transition_applies_forward);
|
||||
|
|
@ -320,5 +320,4 @@ void test_apply_seam(void)
|
|||
RUN_TEST(test_apply_update_transition_noop_on_duplicate);
|
||||
RUN_TEST(test_apply_update_transition_forward_merge_on_terminal_applies);
|
||||
RUN_TEST(test_apply_fail_transition_merges_perr_on_terminal);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ static void test_persist_set_workdir_derives_snap_path(void)
|
|||
|
||||
void test_cluster_persist(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> cluster persist wiring tests (P0-F)\n\n");
|
||||
|
||||
RUN_TEST(test_cluster_t_has_persist_field);
|
||||
|
|
|
|||
|
|
@ -409,6 +409,7 @@ static void test_h4_control_standby_with_lsn1_gets_only_lsn2(void)
|
|||
|
||||
void test_coldstart_lsn0(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_h1_first_noop_lsn1_commits);
|
||||
RUN_TEST(test_h2_real_entry_lsn2_commits);
|
||||
RUN_TEST(test_h3_writable_lsn1_gate_effective);
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ static void test_commit_local_fallback_cap_preserved(void)
|
|||
|
||||
void test_commit_admission_pool(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_commit_fold_uses_pool_cap);
|
||||
RUN_TEST(test_commit_local_fallback_cap_preserved);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3299,7 +3299,7 @@ void test_commit_barrier_reply(void)
|
|||
if (makeString((char *)"cbrp-probe") == NULL)
|
||||
xstring_table_init(139);
|
||||
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* do_jobcontrol_op — Req 1.1, 1.2, 1.4 */
|
||||
RUN_TEST(test_jobctrl_withheld_acks_replies_error);
|
||||
RUN_TEST(test_jobctrl_success_reply_only_after_commit);
|
||||
|
|
@ -3356,5 +3356,4 @@ void test_commit_barrier_reply(void)
|
|||
/* Durable retention held for the outage's sustained duration under
|
||||
* genuine quorum loss (task 4.2, Req 6.1, 6.2) */
|
||||
RUN_TEST(test_fact_state_unchanged_throughout_quorum_loss_outage);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2317,7 +2317,7 @@ static void test_job_submit_single_payload_wal_type_matches_pre_feature_baseline
|
|||
|
||||
void test_commit_barrier_rollout(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Task 1.1 — classification totality + RETAIN routing (Req 2.1, 2.2, 3.1) */
|
||||
RUN_TEST(test_classify_job_submit_is_wait);
|
||||
RUN_TEST(test_classify_job_array_submit_is_wait);
|
||||
|
|
@ -2366,5 +2366,4 @@ void test_commit_barrier_rollout(void)
|
|||
RUN_TEST(test_job_array_submit_one_entry_one_continuation_across_sizes);
|
||||
RUN_TEST(test_job_array_submit_payload_size_bounded_at_max_array_idx);
|
||||
RUN_TEST(test_job_submit_single_payload_wal_type_matches_pre_feature_baseline);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2499,6 +2499,7 @@ static void test_promotion_fence_apply_resource_fenced_survives_structural_catch
|
|||
/* ------------------------------------------------------------------ */
|
||||
void test_commit_durability(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
#ifdef XCE_TESTING
|
||||
RUN_TEST(test_durable_floor_empty);
|
||||
RUN_TEST(test_durable_floor_after_flush);
|
||||
|
|
|
|||
|
|
@ -1585,7 +1585,7 @@ static void test_sync_append_wired_single_member_commits_locally(void)
|
|||
|
||||
void test_commit_engine(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_ack_for_lower_lsn_does_not_commit_higher_entry);
|
||||
RUN_TEST(test_ack_at_entry_plus_self_commits_entry);
|
||||
RUN_TEST(test_out_of_order_watermarks_advance_to_majority_median);
|
||||
|
|
@ -1630,5 +1630,4 @@ void test_commit_engine(void)
|
|||
RUN_TEST(test_sync_append_wired_commits_on_per_entry_majority);
|
||||
RUN_TEST(test_sync_append_wired_stale_acks_time_out);
|
||||
RUN_TEST(test_sync_append_wired_single_member_commits_locally);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1163,6 +1163,7 @@ static void test_commit_resolve_genuine_two_thread_race_majority_wins_over_timeo
|
|||
|
||||
void test_commit_resolve(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_commit_submit_async_returns_immediately_before_commit);
|
||||
RUN_TEST(test_commit_submit_async_rejects_invalid_args);
|
||||
RUN_TEST(test_commit_submit_async_respects_admission_cap);
|
||||
|
|
|
|||
|
|
@ -3962,6 +3962,7 @@ extern int handle_ctrlhello(cluster_t *c, endpoint_t *ep, xce_request_t *req);
|
|||
|
||||
void test_config_repl(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_conf_read_current_filename_missing);
|
||||
RUN_TEST(test_conf_read_current_filename_empty_file);
|
||||
RUN_TEST(test_conf_read_current_filename_path_separator);
|
||||
|
|
|
|||
|
|
@ -1434,6 +1434,7 @@ static void test_promotion_refused_when_apply_resource_fenced_even_if_eligible(v
|
|||
|
||||
void test_convergence_verification(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
#ifdef XCE_TESTING
|
||||
printf("\n>> ACK-driven catch-up continuation tests (RED, task 4.1)\n\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ static void test_transient_jobs_stuck_counter(void)
|
|||
|
||||
void test_ctrl_metrics(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_metrics_init_zeros_all_counters);
|
||||
RUN_TEST(test_metrics_increment_repl_degraded);
|
||||
RUN_TEST(test_metrics_set_gauge);
|
||||
|
|
|
|||
|
|
@ -515,6 +515,7 @@ static void test_ctrlstatus_format_time_ms(void)
|
|||
|
||||
void test_ctrlstatus(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_ctrlstatus_format_time_ms);
|
||||
RUN_TEST(test_ctrlstatus_primary);
|
||||
RUN_TEST(test_ctrlstatus_standby_known_primary);
|
||||
|
|
|
|||
|
|
@ -974,6 +974,7 @@ static void test_ctrlhello_reply_intake_stores_and_reconciles(void)
|
|||
|
||||
void test_demotion_convergence(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
#ifdef XCE_TESTING
|
||||
printf("\n>> demotion convergence + self-restart tests (RED, task 2.1)\n\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ static void test_liveness_reserved_never_exceeds_vcpus_minus_one(void)
|
|||
|
||||
void test_drive_async_config(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_liveness_reserved_normal_three_peers);
|
||||
RUN_TEST(test_liveness_reserved_normal_five_peers);
|
||||
RUN_TEST(test_liveness_reserved_floor_single_node);
|
||||
|
|
|
|||
|
|
@ -337,6 +337,7 @@ static void test_data_job_array_variant_round_trip(void)
|
|||
|
||||
void test_e2e_capnp(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> P0-15e: Cap'n Proto partial merge semantics\n\n");
|
||||
|
||||
RUN_TEST(test_persist_config_capnp_round_trip);
|
||||
|
|
|
|||
|
|
@ -337,6 +337,7 @@ static void test_trim_without_standbys_proceeds_normally(void)
|
|||
|
||||
void test_e2e_checkpoint(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> P0-15b: Checkpoint E2E — round trip\n\n");
|
||||
|
||||
RUN_TEST(test_checkpoint_recovery_lsn_continuity);
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ static void test_checkpoint_gc_removes_expired_entity(void)
|
|||
|
||||
void test_e2e_gc(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> P0-15d: GC E2E — retention + transient job cleanup\n\n");
|
||||
|
||||
RUN_TEST(test_job_gc_retain_running_job);
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ static void test_hook_sequence_preserves_lsn_order(void)
|
|||
|
||||
void test_e2e_hooks(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> P0-15c: Hook E2E — ordering and WAL write\n\n");
|
||||
|
||||
RUN_TEST(test_job_hook_writes_wal_before_lsn_advances);
|
||||
|
|
|
|||
|
|
@ -261,6 +261,7 @@ static void test_wal_chained_crc_detects_corruption(void)
|
|||
|
||||
void test_e2e_wal(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> P0-15a: WAL E2E — torn write + CRC corruption recovery\n\n");
|
||||
|
||||
RUN_TEST(test_wal_write_and_verify_entry_count);
|
||||
|
|
|
|||
|
|
@ -512,6 +512,7 @@ static void test_uncommitted_job_visible_to_status_path(void)
|
|||
|
||||
void test_egress_filter(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> commit-gated scheduler egress tests (GREEN, task 1.2)\n\n");
|
||||
|
||||
RUN_TEST(test_live_submit_tags_submit_lsn);
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ static void test_worker_unavail_zero_dead_since_always_retained(void)
|
|||
|
||||
void test_gc_retention(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_running_job_not_terminal);
|
||||
RUN_TEST(test_pending_job_not_terminal);
|
||||
RUN_TEST(test_exit_job_is_terminal);
|
||||
|
|
|
|||
|
|
@ -452,6 +452,7 @@ static void test_defer_config_fetch_is_false_after_ha_init(void)
|
|||
|
||||
void test_ha_bootstrap(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Req 3.1 — config_tag != 0: bootstrap returns immediately */
|
||||
RUN_TEST(test_bootstrap_returns_immediately_when_config_tag_nonzero);
|
||||
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ static void test_hooks_registered_guard_prevents_double_register(void)
|
|||
|
||||
void test_ha_cluster(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_cluster_t_has_ha_field);
|
||||
RUN_TEST(test_ha_promote_to_primary_uses_c_ha);
|
||||
RUN_TEST(test_ha_demote_to_standby_uses_c_ha);
|
||||
|
|
|
|||
|
|
@ -491,6 +491,7 @@ static void test_follower_passive_no_outbound_connect(void)
|
|||
|
||||
void test_ha_connection_reuse(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Req 1.2 — dispatcher routes by role */
|
||||
RUN_TEST(test_dispatcher_electing_calls_vote_reply_hook);
|
||||
/* test_dispatcher_committing_handles_repl_ack deleted (ha-single-leader-role
|
||||
|
|
|
|||
|
|
@ -2649,7 +2649,7 @@ static void test_6_2_real_senders_never_produce_termblind_shape(void)
|
|||
|
||||
void test_ha_core_safety(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Task 2.1 payload-aware guard set:
|
||||
* (a) empty-then-full — RED (the smoke-RED below): FAILs on the baseline.
|
||||
* (b) full-then-empty — PIN: must not degrade (baseline-passing).
|
||||
|
|
@ -2740,5 +2740,4 @@ void test_ha_core_safety(void)
|
|||
* above and in ha.c. */
|
||||
RUN_TEST(test_6_2_restart_preserves_term_identity);
|
||||
RUN_TEST(test_6_2_real_senders_never_produce_termblind_shape);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ static void test_handle_ctrlhello_rejects_null_body(void)
|
|||
/* ── Suite entry point ──────────────────────────────────────────────────── */
|
||||
void test_ha_ctrlhello(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_ctrl_hello_request_fields_accessible);
|
||||
RUN_TEST(test_ctrl_hello_reply_fields_accessible);
|
||||
RUN_TEST(test_ctrl_hello_req_t_layout);
|
||||
|
|
@ -128,5 +128,4 @@ void test_ha_ctrlhello(void)
|
|||
RUN_TEST(test_request_body_ctrlhellomsg_exists);
|
||||
RUN_TEST(test_handle_ctrlhello_rejects_malformed);
|
||||
RUN_TEST(test_handle_ctrlhello_rejects_null_body);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ static void test_p3_cross_endpoint_not_serialized(void)
|
|||
|
||||
void test_ha_dispatch_integration(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* P1 — transfer (lane) does not block cross-endpoint peer control (pool) */
|
||||
RUN_TEST(test_p1_snapshot_transfer_does_not_block_cross_endpoint);
|
||||
RUN_TEST(test_p1_configpush_transfer_does_not_block_cross_endpoint);
|
||||
|
|
@ -602,5 +602,4 @@ void test_ha_dispatch_integration(void)
|
|||
RUN_TEST(test_p2_ack_runs_under_pool_saturation);
|
||||
/* P3 — cross-endpoint peer control is not serialized */
|
||||
RUN_TEST(test_p3_cross_endpoint_not_serialized);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -385,6 +385,7 @@ static void test_persist_atomicity_tmp_cleaned_up(void)
|
|||
|
||||
void test_ha_durability(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Req 9.1: persist writes a correct, CRC-valid file */
|
||||
RUN_TEST(test_persist_term_writes_file);
|
||||
|
||||
|
|
|
|||
|
|
@ -251,6 +251,7 @@ static void test_carrier_survives_supersession_with_outstanding_endpoint(void)
|
|||
|
||||
void test_ha_elect_ctx_lifecycle(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> ha_elect_ctx_t reference-counted lifecycle tests\n\n");
|
||||
|
||||
RUN_TEST(test_release_at_refcount_one_frees_no_crash);
|
||||
|
|
|
|||
|
|
@ -1220,6 +1220,7 @@ static void test_promotion_never_truncates_own_committed_entries(void)
|
|||
|
||||
void test_ha_election(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Req 2.1 — quorum victory and defeat */
|
||||
RUN_TEST(test_quorum_2_of_3_wins_election);
|
||||
RUN_TEST(test_quorum_exactly_majority_wins);
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ static void test_ha_failover_symbols_exist(void)
|
|||
|
||||
void test_ha_failover(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_rdhup_closes_and_nulls_fd);
|
||||
RUN_TEST(test_rdhup_transitions_to_ctrl_electing);
|
||||
RUN_TEST(test_heartbeat_received_resets_timeout);
|
||||
|
|
@ -408,5 +408,4 @@ void test_ha_failover(void)
|
|||
RUN_TEST(test_ha_failover_symbols_exist);
|
||||
RUN_TEST(test_rdhup_calls_start_election_async);
|
||||
RUN_TEST(test_rdhup_phase2_done_preserved);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -356,6 +356,7 @@ static void test_config_less_node_does_not_start_prevote(void)
|
|||
|
||||
void test_ha_failover_prevote(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Ensure the round LOST/timeout branch never touches a live delaymgr. */
|
||||
g_rearm_calls = 0;
|
||||
ha_prevote_rearm_liveness_hook = stub_rearm;
|
||||
|
|
|
|||
|
|
@ -336,6 +336,7 @@ static void test_consume_null_or_zero_noop(void)
|
|||
|
||||
void test_ha_heartbeat_committed(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_observe_advances_on_higher);
|
||||
RUN_TEST(test_observe_noop_on_equal_or_lower);
|
||||
RUN_TEST(test_observe_noop_on_zero);
|
||||
|
|
|
|||
|
|
@ -2309,7 +2309,7 @@ static void test_configpush_offload_dedups(void)
|
|||
|
||||
void test_ha_liveness(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_liveness_poll_fires_failover_when_timeout);
|
||||
RUN_TEST(test_liveness_poll_rearms_when_fresh);
|
||||
RUN_TEST(test_liveness_poll_cancelled_is_noop);
|
||||
|
|
@ -2353,5 +2353,4 @@ void test_ha_liveness(void)
|
|||
RUN_TEST(test_configpush_offload_runs_on_lane);
|
||||
RUN_TEST(test_configpush_inline_when_flag_off);
|
||||
RUN_TEST(test_configpush_offload_dedups);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -526,8 +526,7 @@ static void test_partition_soak_offload_RED(void)
|
|||
|
||||
void test_ha_partition(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_partition_soak_offload_RED);
|
||||
RUN_TEST(test_partition_soak_offload_GREEN);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -871,7 +871,7 @@ static void test_lost_round_rearms_then_later_failure_elects(void)
|
|||
|
||||
void test_ha_prevote(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_prevote_start_no_mutation);
|
||||
RUN_TEST(test_prevote_majority_grant_starts_real_election);
|
||||
RUN_TEST(test_prevote_no_majority_stays_standby_and_rearms);
|
||||
|
|
@ -886,5 +886,4 @@ void test_ha_prevote(void)
|
|||
RUN_TEST(test_genuine_failover_stale_peer_grants_and_elects);
|
||||
RUN_TEST(test_heartbeat_mid_round_clean_reattach);
|
||||
RUN_TEST(test_lost_round_rearms_then_later_failure_elects);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -644,6 +644,7 @@ static void test_rdhup_within_cooldown_is_debounced(void)
|
|||
|
||||
void test_ha_rdhup_integration(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_rdhup_candidate_advertises_freshness_floor_not_stale_committed);
|
||||
RUN_TEST(test_rdhup_within_cooldown_is_debounced);
|
||||
RUN_TEST(test_rdhup_full_path_reaches_primary);
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ static void test_standby_no_primary_known_when_port_zero(void)
|
|||
|
||||
void test_ha_redirect(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_primary_does_not_redirect);
|
||||
RUN_TEST(test_standby_redirects_when_primary_known);
|
||||
RUN_TEST(test_standby_no_redirect_when_no_primary_known);
|
||||
|
|
|
|||
|
|
@ -303,6 +303,7 @@ static void test_done_posted_prevents_double_push(void)
|
|||
|
||||
void test_ha_repl_push(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_promotion_calls_ctrlhello_push);
|
||||
RUN_TEST(test_promotion_calls_push_config);
|
||||
RUN_TEST(test_standby_result_does_not_push);
|
||||
|
|
|
|||
|
|
@ -864,6 +864,7 @@ static void test_dispatch_gate_allows_ctrlstatus_in_every_role(void)
|
|||
|
||||
void test_ha_role(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_ha_init_default_role_is_standby);
|
||||
RUN_TEST(test_ha_init_rejects_fast_heartbeat);
|
||||
RUN_TEST(test_ha_init_rejects_short_election_timeout);
|
||||
|
|
|
|||
|
|
@ -1165,6 +1165,7 @@ static void test_legacy_and_raft_promotion_are_symmetric(void)
|
|||
|
||||
void test_ha_role_lifecycle(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Task 1.1 — WAL_NOOP no-op entry (Req 2.1) */
|
||||
RUN_TEST(test_noop_append_is_header_only_and_broadcast);
|
||||
RUN_TEST(test_noop_apply_advances_lsn_no_entity_effect);
|
||||
|
|
|
|||
|
|
@ -197,6 +197,7 @@ static void test_single_node_increments_term(void)
|
|||
|
||||
void test_ha_start_election_async(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_single_node_returns_quickly);
|
||||
RUN_TEST(test_single_node_stores_n_peers);
|
||||
RUN_TEST(test_single_node_shortcircuit_evaluates_immediately);
|
||||
|
|
|
|||
|
|
@ -775,6 +775,7 @@ static void test_heartbeat_config_invalid_less_than_double(void)
|
|||
|
||||
void test_ha_startup(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Req 4.1 — even-N peer count */
|
||||
RUN_TEST(test_peer_count_2_is_invalid);
|
||||
RUN_TEST(test_peer_count_4_is_invalid);
|
||||
|
|
|
|||
|
|
@ -627,6 +627,7 @@ static void test_vep_self_teardown_does_not_deadlock(void)
|
|||
|
||||
void test_ha_vep_teardown(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_vep_teardown_runs_after_inflight);
|
||||
RUN_TEST(test_vep_late_event_dropped);
|
||||
RUN_TEST(test_vep_teardown_vtask_disarms_unblock);
|
||||
|
|
|
|||
|
|
@ -265,6 +265,7 @@ static void test_lower_heartbeat_never_lowers_floor(void)
|
|||
|
||||
void test_ha_vote_floor_heartbeat(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_heartbeat_raises_vote_floor_to_max);
|
||||
RUN_TEST(test_candidate_below_raised_floor_rejected);
|
||||
RUN_TEST(test_candidate_at_or_above_raised_floor_accepted);
|
||||
|
|
|
|||
|
|
@ -1117,6 +1117,7 @@ static void test_live_durable_tip_advertised_over_lagging_learned(void)
|
|||
|
||||
void test_ha_vote_gate(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
/* Req 6.1 — PRIMARY denies */
|
||||
RUN_TEST(test_primary_role_denies_vote_request);
|
||||
|
||||
|
|
|
|||
|
|
@ -658,6 +658,7 @@ static void test_bug1417_middle_index_real_vote_from_peer2_not_dropped(void)
|
|||
|
||||
void test_ha_vote_send(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_on_vote_connected_calls_hook_with_correct_opcode);
|
||||
RUN_TEST(test_on_vote_connected_encodes_correct_fields);
|
||||
RUN_TEST(test_on_vote_connected_sets_msg_handler);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ static void test_hook_detail_job_stop_and_resume_are_distinct(void)
|
|||
|
||||
void test_hooks(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> hook detail enum tests\n\n");
|
||||
|
||||
RUN_TEST(test_hook_detail_job_stop_exists);
|
||||
|
|
|
|||
|
|
@ -999,7 +999,7 @@ test_tajd_apply_committed_entry_vs_apply_wal_entry_byte_identical(void)
|
|||
|
||||
void test_job_array_apply(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_rja_expands_contiguous_set_and_tags_lsn);
|
||||
RUN_TEST(test_rja_expands_contiguous_set_across_sizes);
|
||||
RUN_TEST(test_rja_idempotent_whole_record_replay_is_noop);
|
||||
|
|
@ -1015,5 +1015,4 @@ void test_job_array_apply(void)
|
|||
RUN_TEST(test_tajd_job_ctrl_cancels_array_expanded_element_by_identity);
|
||||
RUN_TEST(test_tajd_apply_wal_entry_constructs_all_and_fires_no_hook);
|
||||
RUN_TEST(test_tajd_apply_committed_entry_vs_apply_wal_entry_byte_identical);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -513,6 +513,7 @@ static void test_job_array_fence_engage_refuse_clear_recover_end_to_end(void)
|
|||
|
||||
void test_job_array_fence(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
#ifdef XCE_TESTING
|
||||
RUN_TEST(test_job_array_fence_engage_refuse_clear_recover_end_to_end);
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -661,6 +661,7 @@ test_first_boot_promotion_evaluates_own_first_replay_fence(void)
|
|||
|
||||
void test_job_array_replay_fence(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
#ifdef XCE_TESTING
|
||||
RUN_TEST(test_replay_wal_engages_fence_on_resource_exhaustion_failure);
|
||||
RUN_TEST(test_first_boot_promotion_evaluates_own_first_replay_fence);
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ static void test_no_primary_known_yields_nomaster_not_redirect(void)
|
|||
|
||||
void test_join_redirect(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_redirect_reply_carries_primary_address);
|
||||
RUN_TEST(test_no_primary_known_yields_nomaster_not_redirect);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ static void test_hooks_registered_guard_integration(void)
|
|||
|
||||
void test_p1_integration(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_single_node_starts_as_primary);
|
||||
RUN_TEST(test_term_fencing_monotonic);
|
||||
RUN_TEST(test_redirect_guard_integration);
|
||||
|
|
|
|||
|
|
@ -460,6 +460,7 @@ static void test_committed_lsn_advances_after_majority_ack(void)
|
|||
|
||||
void test_p2_integration(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_repl_broadcast_rejects_checkpoint);
|
||||
RUN_TEST(test_trim_lsn_with_active_standby_at_lsn_5);
|
||||
RUN_TEST(test_checkpoint_does_not_update_replicated_crc);
|
||||
|
|
|
|||
|
|
@ -451,6 +451,7 @@ static void test_p3_gc_recent_done_job_retained(void)
|
|||
|
||||
void test_p3_hardening(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> P3-1..P3-5: Integration & Hardening\n\n");
|
||||
|
||||
/* P3-1: Failover state machine */
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ static void test_manual_failover_monotonic_term_across_multiple_cycles(void)
|
|||
|
||||
void test_p3_manual_failover(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_manual_failover_transitions_role_and_increments_term);
|
||||
RUN_TEST(test_manual_failover_resets_hooks_registered);
|
||||
RUN_TEST(test_manual_failover_monotonic_term_across_multiple_cycles);
|
||||
|
|
|
|||
|
|
@ -243,6 +243,7 @@ static void test_checkpoint_rotation_keeps_snap_keep_n(void)
|
|||
|
||||
void test_persist_checkpoint(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_checkpoint_creates_snapshot_file);
|
||||
RUN_TEST(test_checkpoint_sets_checkpoint_lsn);
|
||||
RUN_TEST(test_checkpoint_lsn_tracks_last_applied_not_current_lsn);
|
||||
|
|
|
|||
|
|
@ -455,6 +455,7 @@ static void test_job_hook_new_writes_multiple_entries_sequentially(void)
|
|||
|
||||
void test_persist_hooks(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> persist hook function tests\n\n");
|
||||
|
||||
RUN_TEST(test_job_hook_new_writes_wal_entry);
|
||||
|
|
|
|||
|
|
@ -388,6 +388,7 @@ static void test_recovered_member_syncs_raft_log_len(void)
|
|||
|
||||
void test_persist_recovery(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_recover_from_empty_state);
|
||||
RUN_TEST(test_recover_loads_checkpoint_lsn);
|
||||
RUN_TEST(test_recover_replays_wal_after_checkpoint);
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ static void test_last_replicated_crc_not_updated_for_checkpoint(void)
|
|||
|
||||
void test_persist_repl(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_persist_has_repl_field);
|
||||
RUN_TEST(test_wal_async_no_standbys_succeeds);
|
||||
RUN_TEST(test_wal_sync_no_standbys_returns_enodev_in_sync_rc);
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ static void test_worker_dead_since_field(void)
|
|||
|
||||
void test_persist_schema(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> persist Cap'n Proto schema test\n\n");
|
||||
|
||||
RUN_TEST(test_persist_config_schema_fields);
|
||||
|
|
|
|||
|
|
@ -1286,6 +1286,7 @@ static void test_snapent_load_snapshot_legacy_file_reports_position_only(void)
|
|||
|
||||
void test_persist_snapshot_entities(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> entity-bearing snapshot fixture tests\n\n");
|
||||
|
||||
/* makeJob's deep-copy path (job_init -> makeJobsub -> makeString) needs
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ static void test_truncate_concurrent_burst_resolves_above_cutoff_exactly_once(vo
|
|||
|
||||
void test_persist_truncate(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_truncate_at_segment_boundary_deletes_segment);
|
||||
RUN_TEST(test_truncate_mid_segment_at_correct_offset);
|
||||
RUN_TEST(test_truncate_idempotent);
|
||||
|
|
@ -501,5 +501,4 @@ void test_persist_truncate(void)
|
|||
RUN_TEST(test_truncate_above_resolves_pending_continuations_as_failed);
|
||||
RUN_TEST(test_truncate_noop_does_not_resolve_pending_continuations);
|
||||
RUN_TEST(test_truncate_concurrent_burst_resolves_above_cutoff_exactly_once);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ static void test_slot_key_t_fields(void)
|
|||
|
||||
void test_persist_types(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> persist types test\n\n");
|
||||
|
||||
RUN_TEST(test_wal_header_size);
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ static void test_persist_config_defaults_max_wal_records(void)
|
|||
|
||||
void test_persist_wal(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> persist WAL writer test\n\n");
|
||||
|
||||
RUN_TEST(test_persist_init_creates_directories);
|
||||
|
|
|
|||
|
|
@ -535,6 +535,7 @@ static void test_repl_catchup_durable_floor_survives_failover(void)
|
|||
|
||||
void test_repl_apply(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_apply_wal_entry_advances_lsn);
|
||||
RUN_TEST(test_apply_wal_entry_skips_checkpoint);
|
||||
RUN_TEST(test_apply_wal_entry_rejects_oversized);
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ static void test_repl_needs_snapshot_standby_within_wal(void)
|
|||
|
||||
void test_repl_catchup(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_start_catchup_sets_in_catch_up);
|
||||
RUN_TEST(test_complete_catchup_clears_in_catch_up);
|
||||
RUN_TEST(test_wait_ack_excludes_catching_up_standby);
|
||||
|
|
|
|||
|
|
@ -306,12 +306,11 @@ static void test_broadcast_over_limit_removes_standby(void)
|
|||
|
||||
void test_repl_majority(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_wait_majority_ack_two_of_three_returns_zero);
|
||||
RUN_TEST(test_wait_majority_ack_stale_acks_time_out);
|
||||
RUN_TEST(test_wait_majority_ack_no_standbys_returns_zero);
|
||||
RUN_TEST(test_wait_majority_ack_catchup_excluded_from_quorum);
|
||||
RUN_TEST(test_wait_majority_ack_ack_op_discriminates);
|
||||
RUN_TEST(test_broadcast_over_limit_removes_standby);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@ static void test_repl_registration_lifecycle(void) {
|
|||
}
|
||||
|
||||
void test_repl_unit(void) {
|
||||
UNITY_BEGIN();
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_repl_init_zeroes_nstandbys);
|
||||
RUN_TEST(test_repl_add_remove_standby);
|
||||
RUN_TEST(test_repl_add_standby_max);
|
||||
|
|
@ -608,5 +608,4 @@ void test_repl_unit(void) {
|
|||
RUN_TEST(test_wal_nack_does_not_update_acked_lsn);
|
||||
/* Task 5.3: registration lifecycle — Req 1.1, 1.2, 1.3 */
|
||||
RUN_TEST(test_repl_registration_lifecycle);
|
||||
UNITY_END();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -397,5 +397,6 @@ static void test_replay_applies_every_classified_type_via_apply_seam(void)
|
|||
|
||||
void test_replay_apply_seam(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_replay_applies_every_classified_type_via_apply_seam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,6 +308,7 @@ static void test_fini_on_idle_lane(void)
|
|||
|
||||
void test_slowlane(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_submit_is_non_blocking);
|
||||
RUN_TEST(test_admission_cap_bounds_concurrency);
|
||||
RUN_TEST(test_submit_returns_eagain_when_cap_full);
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ static void test_missing_path_errors(void)
|
|||
|
||||
void test_snapdiff(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_identical_files);
|
||||
RUN_TEST(test_size_mismatch);
|
||||
RUN_TEST(test_diff_at_chunk_boundary_is_flagged);
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ static void test_missing_path_errors(void)
|
|||
|
||||
void test_snapverify(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_legacy_position_only_file_is_ok);
|
||||
RUN_TEST(test_entity_bearing_well_formed_file_is_ok);
|
||||
RUN_TEST(test_bad_magic_is_einval);
|
||||
|
|
|
|||
|
|
@ -2171,6 +2171,7 @@ static void test_every_callback_and_marker_path_end_to_end(void)
|
|||
|
||||
void test_term_safety_adapter(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_wal_entry_hdr_size_is_40);
|
||||
RUN_TEST(test_set_term_stamps_append);
|
||||
RUN_TEST(test_recover_mixed_real_and_legacy_terms);
|
||||
|
|
|
|||
|
|
@ -629,6 +629,7 @@ static void test_report_uncommitted_tail_classified(void)
|
|||
|
||||
void test_walcompare(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_identical_members_ok);
|
||||
RUN_TEST(test_same_lsn_diff_term_divergent);
|
||||
RUN_TEST(test_same_lsn_diff_payload_divergent);
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ static void test_non_wal_file_errors(void)
|
|||
|
||||
void test_waldump(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
RUN_TEST(test_contiguous_log_has_no_gaps);
|
||||
RUN_TEST(test_missing_prefix_flagged_as_gap);
|
||||
RUN_TEST(test_duplicate_submit_detection);
|
||||
|
|
|
|||
|
|
@ -514,6 +514,7 @@ static void test_rejoin_worker_preserves_admin_bits(void)
|
|||
|
||||
void test_worker_join(void)
|
||||
{
|
||||
UnitySetTestFile(__FILE__);
|
||||
printf("\n>> worker join refactor tests\n\n");
|
||||
|
||||
/* xstring_table_init must be called once before any makeString usage */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue