![]() |
FOSSology
4.7.1
Open Source License Compliance by Open Source Software
|
Unit test for job operations. More...
#include <testRun.h>#include <agent.h>#include <scheduler.h>#include <job.h>#include <utils.h>#include <string.h>
Go to the source code of this file.
Macros | |
| #define | STRESS_USERS 15 |
| #define | STRESS_UPLOADS 20 |
| #define | STRESS_N_JOBS (STRESS_USERS * STRESS_UPLOADS) |
| #define | STRESS_BASE_ID 50000 |
Functions | |
| int | Prepare_Testing_Data_Job (scheduler_t *scheduler) |
| void | test_job_event () |
| Test for job events. More... | |
| void | test_job_fun () |
| Test for job functions. More... | |
| void | test_scheduler_high_load_no_false_stale (void) |
| Jobs blocked at max_run must not be reaped as stale. More... | |
| void | test_scheduler_priority_order_preserved (void) |
| Priority ordering must be preserved after a blocked-job skip. More... | |
| void | test_agent_transition_null_owner_safe (void) |
| agent_transition() must not crash when agent->owner is NULL. | |
| void | test_meta_agent_negative_max_run_is_unlimited (void) |
| Regression: max_run < 0 must mean unlimited, not "limit reached". More... | |
Variables | |
| CU_TestInfo | tests_job [] |
Unit test for job operations.
Definition in file testJob.c.
| int Prepare_Testing_Data_Job | ( | scheduler_t * | scheduler | ) |
| void test_job_event | ( | ) |
Test for job events.
| void test_job_fun | ( | ) |
Test for job functions.
| void test_meta_agent_negative_max_run_is_unlimited | ( | void | ) |
Regression: max_run < 0 must mean unlimited, not "limit reached".
The old isMaxLimitReached() used (max_run <= run_count), so max_run=-1 with run_count=0 wrongly reported the limit reached and blocked unlimited agents. The guard max_run >= 0 fixes it: max_run=-1 is unlimited, max_run=0 blocks.
| void test_scheduler_high_load_no_false_stale | ( | void | ) |
Jobs blocked at max_run must not be reaped as stale.
Ages 300 jobs past the grace period then runs one scheduler_update() cycle. The skip loop refreshes checkedout_at so the stale reaper finds nothing.
| void test_scheduler_priority_order_preserved | ( | void | ) |
Priority ordering must be preserved after a blocked-job skip.
Three jobs (-10/0/+10 priority), all blocked. After scheduler_update() the highest-priority job must still be at the front of the queue.
| CU_TestInfo tests_job[] |