feat(libxce-alloc-preason-equality): drop sim verify tests that duplicate libxce alloc_eq coverage (task 5.1)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
24b057189f
commit
a9c984775f
2 changed files with 1 additions and 87 deletions
|
|
@ -632,51 +632,6 @@ static void test_dispatch_decisions_differing_jobid_mismatch(void)
|
|||
printf("test_dispatch_decisions_differing_jobid_mismatch: PASS\n");
|
||||
}
|
||||
|
||||
static void test_dispatch_decisions_differing_host_mismatch(void)
|
||||
{
|
||||
xce_alloc_t* res[1] = { make_test_alloc("gpu", "r", 1, 1.0, 0, 0) };
|
||||
xce_host_alloc_t* host[1] = { make_test_host_alloc("hostA", res, 1) };
|
||||
xce_job_alloc_t* expected_alloc = make_test_job_alloc(42, host, 1);
|
||||
|
||||
xce_alloc_t* res2[1] = { make_test_alloc("gpu", "r", 1, 1.0, 0, 0) };
|
||||
xce_host_alloc_t* host2[1] = { make_test_host_alloc("hostB", res2, 1) };
|
||||
xce_job_alloc_t* actual_alloc = make_test_job_alloc(42, host2, 1);
|
||||
|
||||
replay_decision_t expected = make_replay_dispatch_decision(expected_alloc);
|
||||
xce_decision_t* actual = make_dispatch_decision(actual_alloc);
|
||||
|
||||
char* why = NULL;
|
||||
|
||||
TEST_ASSERT_FALSE(sim_decision_eq(&expected, actual, &why));
|
||||
assert_why_names(why, "allocs[0](host=hostA).host: \"hostA\" != "
|
||||
"\"hostB\"");
|
||||
|
||||
printf("test_dispatch_decisions_differing_host_mismatch: PASS\n");
|
||||
}
|
||||
|
||||
static void test_dispatch_decisions_differing_resource_value_mismatch(void)
|
||||
{
|
||||
xce_alloc_t* res[1] = { make_test_alloc("gpu", "r", 1, 1.0, 0, 0) };
|
||||
xce_host_alloc_t* host[1] = { make_test_host_alloc("hostA", res, 1) };
|
||||
xce_job_alloc_t* expected_alloc = make_test_job_alloc(42, host, 1);
|
||||
|
||||
xce_alloc_t* res2[1] = { make_test_alloc("gpu", "r", 1, 2.0, 0, 0) };
|
||||
xce_host_alloc_t* host2[1] = { make_test_host_alloc("hostA", res2, 1) };
|
||||
xce_job_alloc_t* actual_alloc = make_test_job_alloc(42, host2, 1);
|
||||
|
||||
replay_decision_t expected = make_replay_dispatch_decision(expected_alloc);
|
||||
xce_decision_t* actual = make_dispatch_decision(actual_alloc);
|
||||
|
||||
char* why = NULL;
|
||||
|
||||
TEST_ASSERT_FALSE(sim_decision_eq(&expected, actual, &why));
|
||||
assert_why_names(why, "allocs[0](host=hostA).allocs[0](resname=gpu)."
|
||||
"value: 1 != 2");
|
||||
|
||||
printf("test_dispatch_decisions_differing_resource_value_mismatch: "
|
||||
"PASS\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* test_dispatch_decisions_differing_from_timestamp_mismatch -
|
||||
* libxce-alloc-preason-equality Requirement 5.1 (inverts the former
|
||||
|
|
@ -714,44 +669,6 @@ static void test_dispatch_decisions_differing_from_timestamp_mismatch(void)
|
|||
"PASS\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* test_dispatch_decisions_differing_instid_still_match - bug-1844
|
||||
* regression: `instid` (xce_alloc_t's per-process monotonic allocation-
|
||||
* instance counter, stamped from `sched->core.nextid++` at allocation-build
|
||||
* time -- scheduler.c's sched_get_id()) is an execution-order bookkeeping
|
||||
* value, not part of a decision's semantic identity. It is the one field
|
||||
* libxce's alloc_eq() excludes (`from`, unlike instid, is now compared: see
|
||||
* test_dispatch_decisions_differing_from_timestamp_mismatch above). The
|
||||
* ORIGINAL recording's counter may have been
|
||||
* running, and building allocations, for far longer before this capture
|
||||
* window started; a fresh replay's own counter starts whatever its loaded
|
||||
* snapshot's nextid happens to be -- the two have no reason to reach the
|
||||
* same value for "the same" dispatch, even when every other field is
|
||||
* byte-for-byte identical. Uses two `instid` values matching a real
|
||||
* captured .replay file's own observed divergence (826 vs 1) to prove this
|
||||
* is deliberate exclusion, not a fluke of small numbers happening to
|
||||
* coincide.
|
||||
*/
|
||||
static void test_dispatch_decisions_differing_instid_still_match(void)
|
||||
{
|
||||
xce_alloc_t* res_a[1]
|
||||
= { make_test_alloc("mem", "", 826ULL, 307200.0, 100, -1) };
|
||||
xce_host_alloc_t* host_a[1] = { make_test_host_alloc("hostA", res_a, 1) };
|
||||
xce_job_alloc_t* expected_alloc = make_test_job_alloc(42, host_a, 1);
|
||||
|
||||
xce_alloc_t* res_b[1]
|
||||
= { make_test_alloc("mem", "", 1ULL, 307200.0, 100, -1) };
|
||||
xce_host_alloc_t* host_b[1] = { make_test_host_alloc("hostA", res_b, 1) };
|
||||
xce_job_alloc_t* actual_alloc = make_test_job_alloc(42, host_b, 1);
|
||||
|
||||
replay_decision_t expected = make_replay_dispatch_decision(expected_alloc);
|
||||
xce_decision_t* actual = make_dispatch_decision(actual_alloc);
|
||||
|
||||
TEST_ASSERT_TRUE(sim_decision_eq(&expected, actual, NULL));
|
||||
|
||||
printf("test_dispatch_decisions_differing_instid_still_match: PASS\n");
|
||||
}
|
||||
|
||||
static void test_pend_decisions_with_identical_content_match(void)
|
||||
{
|
||||
replay_decision_t expected = make_replay_pend_decision(9001ULL, 3);
|
||||
|
|
@ -2070,10 +1987,7 @@ int main(void)
|
|||
|
||||
RUN_TEST(test_dispatch_decisions_with_identical_content_match);
|
||||
RUN_TEST(test_dispatch_decisions_differing_jobid_mismatch);
|
||||
RUN_TEST(test_dispatch_decisions_differing_host_mismatch);
|
||||
RUN_TEST(test_dispatch_decisions_differing_resource_value_mismatch);
|
||||
RUN_TEST(test_dispatch_decisions_differing_from_timestamp_mismatch);
|
||||
RUN_TEST(test_dispatch_decisions_differing_instid_still_match);
|
||||
RUN_TEST(test_pend_decisions_with_identical_content_match);
|
||||
RUN_TEST(test_pend_decisions_differing_jobid_mismatch);
|
||||
RUN_TEST(test_pend_decisions_differing_main_reason_mismatch);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue