From e8ba7575a796c87ea44f18a920cc77d9b5e6ec84 Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Wed, 28 Feb 2024 09:32:47 -0800 Subject: [PATCH 1/9] plugin: remove split_string () helper function Problem: The split_string () function was never removed when the change was made to use the new-and-improved split_string_and_push_back () function defined in accounting.cpp. Remove the split_string () function from the plugin code. --- src/plugins/mf_priority.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/plugins/mf_priority.cpp b/src/plugins/mf_priority.cpp index dec78a31..07ca4229 100644 --- a/src/plugins/mf_priority.cpp +++ b/src/plugins/mf_priority.cpp @@ -158,19 +158,6 @@ static int get_queue_info (char *queue, } -static void split_string (char *queues, Association *b) -{ - std::stringstream s_stream; - - s_stream << queues; // create string stream from string - while (s_stream.good ()) { - std::string substr; - getline (s_stream, substr, ','); // get string delimited by comma - b->queues.push_back (substr); - } -} - - int check_queue_factor (flux_plugin_t *p, int queue_factor, char *queue, From e3bf369eacc125d25332d027a2be6e662af62439 Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Wed, 28 Feb 2024 09:53:02 -0800 Subject: [PATCH 2/9] plugin: move get_queue_info () to accounting.cpp Problem: get_queue_info () is a helper function that is specific to flux-accounting in the fact that it is validating a queue that a user may or may not have submitted a job under and potentially receiving a priority bump because of it. It would make more sense to move this out of the plugin and into accounting.cpp. Move get_queue_info (), struct queue_info, and the special queue definitions to accounting.*. Add the "queues" map as a parameter to the get_queue_info () definition. --- src/plugins/accounting.cpp | 34 +++++++++++++++++++ src/plugins/accounting.hpp | 26 +++++++++++++++ src/plugins/mf_priority.cpp | 66 ++++--------------------------------- 3 files changed, 67 insertions(+), 59 deletions(-) diff --git a/src/plugins/accounting.cpp b/src/plugins/accounting.cpp index 7493d890..0e5e7caa 100644 --- a/src/plugins/accounting.cpp +++ b/src/plugins/accounting.cpp @@ -140,3 +140,37 @@ void split_string_and_push_back (const char *list, vec.push_back (substr); } } + + +int get_queue_info (char *queue, + std::vector permissible_queues, + std::map queues) +{ + std::map::iterator q_it; + + // make sure that if a queue is passed in, it is a valid queue for the + // user to run jobs in + if (queue != NULL) { + // check #1) the queue passed in exists in the queues map; + // if the queue cannot be found, this means that flux-accounting + // does not know about the queue, and thus should return a default + // factor + q_it = queues.find (queue); + if (q_it == queues.end ()) + return UNKNOWN_QUEUE; + + // check #2) the queue passed in is a valid option to pass for user + std::vector::iterator vect_it; + vect_it = std::find (permissible_queues.begin (), + permissible_queues.end (), queue); + + if (vect_it == permissible_queues.end ()) + return INVALID_QUEUE; + else + // add priority associated with the passed in queue to bank_info + return queues[queue].priority; + } else { + // no queue was specified, so just use a default queue factor + return NO_QUEUE_SPECIFIED; + } +} diff --git a/src/plugins/accounting.hpp b/src/plugins/accounting.hpp index 170df86f..2a4cb0f4 100644 --- a/src/plugins/accounting.hpp +++ b/src/plugins/accounting.hpp @@ -26,6 +26,7 @@ extern "C" { #include #include #include +#include // all attributes are per-user/bank class Association { @@ -46,6 +47,25 @@ class Association { json_t* to_json () const; // convert object to JSON string }; +// - UKNOWN_QUEUE: a queue is specified for a submitted job that flux-accounting +// does not know about +// - NO_QUEUE_SPECIFIED: no queue was specified for this job +// - INVALID_QUEUE: the association does not have permission to run jobs under +// this queue +#define UNKNOWN_QUEUE 0 +#define NO_QUEUE_SPECIFIED 0 +#define INVALID_QUEUE -6 + +// min_nodes_per_job, max_nodes_per_job, and max_time_per_job are not +// currently used or enforced in this plugin, so their values have no +// effect in queue limit enforcement. +struct queue_info { + int min_nodes_per_job; + int max_nodes_per_job; + int max_time_per_job; + int priority; +}; + // get an Association object that points to user/bank in the users map; // return nullptr on failure Association* get_association (int userid, @@ -62,4 +82,10 @@ json_t* convert_map_to_json (std::map> void split_string_and_push_back (const char *list, std::vector &vec); +// validate a potentially passed-in queue by an association and return the +// integer priority associated with the queue +int get_queue_info (char *queue, + std::vector permissible_queues, + std::map queues); + #endif // ACCOUNTING_H diff --git a/src/plugins/mf_priority.cpp b/src/plugins/mf_priority.cpp index 07ca4229..f810560a 100644 --- a/src/plugins/mf_priority.cpp +++ b/src/plugins/mf_priority.cpp @@ -37,31 +37,10 @@ extern "C" { // flux-accounting #define BANK_INFO_MISSING 999 -// a queue is specified for a submitted job that flux-accounting does not know -// about -#define UNKNOWN_QUEUE 0 - -// no queue is specified for a submitted job -#define NO_QUEUE_SPECIFIED 0 - -// a queue was specified for a submitted job that flux-accounting knows about and -// the association does not have permission to run jobs under -#define INVALID_QUEUE -6 - std::map> users; std::map queues; std::map users_def_bank; -// min_nodes_per_job, max_nodes_per_job, and max_time_per_job are not -// currently used or enforced in this plugin, so their values have no -// effect in queue limit enforcement. -struct queue_info { - int min_nodes_per_job; - int max_nodes_per_job; - int max_time_per_job; - int priority; -}; - /****************************************************************************** * * * Helper Functions * @@ -125,39 +104,6 @@ int64_t priority_calculation (flux_plugin_t *p, } -static int get_queue_info (char *queue, - std::vector permissible_queues) -{ - std::map::iterator q_it; - - // make sure that if a queue is passed in, it is a valid queue for the - // user to run jobs in - if (queue != NULL) { - // check #1) the queue passed in exists in the queues map; - // if the queue cannot be found, this means that flux-accounting - // does not know about the queue, and thus should return a default - // factor - q_it = queues.find (queue); - if (q_it == queues.end ()) - return UNKNOWN_QUEUE; - - // check #2) the queue passed in is a valid option to pass for user - std::vector::iterator vect_it; - vect_it = std::find (permissible_queues.begin (), - permissible_queues.end (), queue); - - if (vect_it == permissible_queues.end ()) - return INVALID_QUEUE; - else - // add priority associated with the passed in queue to bank_info - return queues[queue].priority; - } else { - // no queue was specified, so just use a default queue factor - return NO_QUEUE_SPECIFIED; - } -} - - int check_queue_factor (flux_plugin_t *p, int queue_factor, char *queue, @@ -475,7 +421,9 @@ static int priority_cb (flux_plugin_t *p, return flux_jobtap_priority_unavail (p, args); // fetch priority of the associated queue - assoc->queue_factor = get_queue_info (queue, assoc->queues); + assoc->queue_factor = get_queue_info (queue, + assoc->queues, + queues); if (assoc->queue_factor == INVALID_QUEUE) // the queue the association specified is invalid return -1; @@ -619,7 +567,7 @@ static int validate_cb (flux_plugin_t *p, return flux_jobtap_reject_job (p, args, "user/bank entry has been " "disabled from flux-accounting DB"); - if (get_queue_info (queue, a->queues) == INVALID_QUEUE) + if (get_queue_info (queue, a->queues, queues) == INVALID_QUEUE) // the user/bank specified a queue that they do not belong to; // reject the job return flux_jobtap_reject_job (p, args, "Queue not valid for user: %s", @@ -701,7 +649,7 @@ static int new_cb (flux_plugin_t *p, } // assign priority associated with validated queue - b->queue_factor = get_queue_info (queue, b->queues); + b->queue_factor = get_queue_info (queue, b->queues, queues); max_run_jobs = b->max_run_jobs; cur_active_jobs = b->cur_active_jobs; @@ -872,7 +820,7 @@ static int job_updated (flux_plugin_t *p, // the queue for the job has been updated, so fetch the priority // associated with this queue and assign it to the Association object // associated with the job - a->queue_factor = get_queue_info (updated_queue, a->queues); + a->queue_factor = get_queue_info (updated_queue, a->queues, queues); return 0; } @@ -913,7 +861,7 @@ static int update_queue_cb (flux_plugin_t *p, "for uid: %i", userid); // validate the updated queue and make sure the user/bank has access to it; - if (get_queue_info (updated_queue, a->queues) == INVALID_QUEUE) + if (get_queue_info (updated_queue, a->queues, queues) == INVALID_QUEUE) // user/bank does not have access to this queue; reject the update return flux_jobtap_error (p, args, From 8f9a912dacf81c9ebff8b1f99f7f5fa6a95904b1 Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Wed, 28 Feb 2024 10:05:53 -0800 Subject: [PATCH 3/9] accounting.cpp: improve get_queue_info () Problem: The get_queue_info () function could use some minor improvements to its comment structure and some clean up to its if-else checks. Slightly modify some of the comments in this function and use auto for the declaration of the vector iterators used in get_queue_info (). Clean up some of the if-else checks where "else" is not necessarily needed. --- src/plugins/accounting.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/plugins/accounting.cpp b/src/plugins/accounting.cpp index 0e5e7caa..bdf659ee 100644 --- a/src/plugins/accounting.cpp +++ b/src/plugins/accounting.cpp @@ -146,31 +146,26 @@ int get_queue_info (char *queue, std::vector permissible_queues, std::map queues) { - std::map::iterator q_it; - - // make sure that if a queue is passed in, it is a valid queue for the - // user to run jobs in if (queue != NULL) { // check #1) the queue passed in exists in the queues map; // if the queue cannot be found, this means that flux-accounting // does not know about the queue, and thus should return a default // factor - q_it = queues.find (queue); + auto q_it = queues.find (queue); if (q_it == queues.end ()) return UNKNOWN_QUEUE; - // check #2) the queue passed in is a valid option to pass for user - std::vector::iterator vect_it; - vect_it = std::find (permissible_queues.begin (), - permissible_queues.end (), queue); - + // check #2) the queue passed in is valid for the association + auto vect_it = std::find (permissible_queues.begin (), + permissible_queues.end (), + queue); if (vect_it == permissible_queues.end ()) + // the queue passed in is not valid for the association return INVALID_QUEUE; - else - // add priority associated with the passed in queue to bank_info - return queues[queue].priority; - } else { - // no queue was specified, so just use a default queue factor - return NO_QUEUE_SPECIFIED; + + return queues[queue].priority; } + + // no queue was specified, so just use a default queue factor + return NO_QUEUE_SPECIFIED; } From fcbedab024797e62bb2b3145b79a3fe85c2a42b3 Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Wed, 28 Feb 2024 10:17:22 -0800 Subject: [PATCH 4/9] plugin: change struct queue_info -> class Queue Problme: The plugin used to define a struct for queue_info objects, but now that we have external files for flux-accounting-specific stuff, it would make more sense to instead define a class for Queue objects that is structured similarly to the Association class. Convert the struct queue_info definition to a class Queue definition. Replace the usage of struct queue_info in both get_queue_info () and in the plugin code itself with the new class Queue. Use const references as parameters in the get_queue_info () function definition. --- src/plugins/accounting.cpp | 10 +++++++--- src/plugins/accounting.hpp | 7 ++++--- src/plugins/mf_priority.cpp | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/plugins/accounting.cpp b/src/plugins/accounting.cpp index bdf659ee..d6b188f8 100644 --- a/src/plugins/accounting.cpp +++ b/src/plugins/accounting.cpp @@ -143,8 +143,8 @@ void split_string_and_push_back (const char *list, int get_queue_info (char *queue, - std::vector permissible_queues, - std::map queues) + const std::vector &permissible_queues, + const std::map &queues) { if (queue != NULL) { // check #1) the queue passed in exists in the queues map; @@ -163,7 +163,11 @@ int get_queue_info (char *queue, // the queue passed in is not valid for the association return INVALID_QUEUE; - return queues[queue].priority; + try { + return queues.at (queue).priority; + } catch (const std::out_of_range &e) { + return UNKNOWN_QUEUE; + } } // no queue was specified, so just use a default queue factor diff --git a/src/plugins/accounting.hpp b/src/plugins/accounting.hpp index 2a4cb0f4..23e158be 100644 --- a/src/plugins/accounting.hpp +++ b/src/plugins/accounting.hpp @@ -59,7 +59,8 @@ class Association { // min_nodes_per_job, max_nodes_per_job, and max_time_per_job are not // currently used or enforced in this plugin, so their values have no // effect in queue limit enforcement. -struct queue_info { +class Queue { +public: int min_nodes_per_job; int max_nodes_per_job; int max_time_per_job; @@ -85,7 +86,7 @@ void split_string_and_push_back (const char *list, // validate a potentially passed-in queue by an association and return the // integer priority associated with the queue int get_queue_info (char *queue, - std::vector permissible_queues, - std::map queues); + const std::vector &permissible_queues, + const std::map &queues); #endif // ACCOUNTING_H diff --git a/src/plugins/mf_priority.cpp b/src/plugins/mf_priority.cpp index f810560a..17709255 100644 --- a/src/plugins/mf_priority.cpp +++ b/src/plugins/mf_priority.cpp @@ -38,7 +38,7 @@ extern "C" { #define BANK_INFO_MISSING 999 std::map> users; -std::map queues; +std::map queues; std::map users_def_bank; /****************************************************************************** @@ -315,7 +315,7 @@ static void rec_q_cb (flux_t *h, "priority", &priority) < 0) flux_log (h, LOG_ERR, "mf_priority unpack: %s", error.text); - struct queue_info *q; + Queue *q; q = &queues[queue]; q->min_nodes_per_job = min_nodes_per_job; From d7ce1e153d177364fd346d470f2169c2ca7f827b Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Wed, 28 Feb 2024 10:35:01 -0800 Subject: [PATCH 5/9] test: add unit tests for get_queue_info () Problem: There exists no tests for the get_queue_info () function. Add some basic unit tests for this function. --- src/plugins/test/accounting_test01.cpp | 73 +++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/src/plugins/test/accounting_test01.cpp b/src/plugins/test/accounting_test01.cpp index 5687c947..6a9357d4 100644 --- a/src/plugins/test/accounting_test01.cpp +++ b/src/plugins/test/accounting_test01.cpp @@ -26,6 +26,8 @@ extern "C" { // define a test users map to run tests on std::map> users; std::map users_def_bank; +// define a test queues map +std::map queues; /* @@ -70,6 +72,16 @@ void initialize_map ( } +/* + * helper function to add test queues to the queues map + */ +void initialize_queues () { + queues["bronze"] = {0, 5, 60, 100}; + queues["silver"] = {0, 5, 60, 200}; + queues["gold"] = {0, 5, 60, 300}; +} + + // ensure we can access a user/bank in the users map static void test_direct_map_access ( std::map> &users) @@ -125,20 +137,77 @@ static void split_string_and_push_back_success () } +// ensure the correct priority factor is returned for a valid queue +static void test_get_queue_info_success () +{ + Association a = users[1001]["bank_A"]; + a.queues = {"bronze", "silver"}; + a.queue_factor = get_queue_info (const_cast ("bronze"), + a.queues, + queues); + + ok (a.queue_factor == 100, + "get_queue_info () returns the associated priority on success"); +} + + +// ensure NO_QUEUE_SPECIFIED is returned when queue is NULL +static void test_get_queue_info_no_queue_specified () +{ + Association a = users[1001]["bank_A"]; + a.queue_factor = get_queue_info (NULL, a.queues, queues); + + ok (a.queue_factor == NO_QUEUE_SPECIFIED, + "NO_QUEUE_SPECIFIED is returned when no queue is passed in"); +} + + +// ensure UNKOWN_QUEUE is returned when an unrecognized queue is passed in +static void test_get_queue_info_unknown_queue () +{ + Association a = users[1001]["bank_A"]; + a.queue_factor = get_queue_info (const_cast ("platinum"), + a.queues, + queues); + + ok (a.queue_factor == UNKNOWN_QUEUE, + "UNKNOWN_QUEUE is returned when an unrecognized queue is passed in"); +} + + +// ensure INVALID_QUEUE is returned when an unrecognized queue is passed in +static void test_get_queue_info_invalid_queue () +{ + Association a = users[1001]["bank_A"]; + a.queues = {"bronze", "silver"}; + a.queue_factor = get_queue_info (const_cast ("gold"), + a.queues, + queues); + + ok (a.queue_factor == INVALID_QUEUE, + "INVALID_QUEUE is returned when an inaccessible queue is passed in"); +} + + int main (int argc, char* argv[]) { // declare the number of tests that we plan to run - plan (5); + plan (9); // add users to the test map initialize_map (users); + // add queues to the test queues map + initialize_queues (); test_direct_map_access (users); test_get_association_success (); test_get_association_noexist (); test_get_association_no_default_bank (); split_string_and_push_back_success (); - + test_get_queue_info_success (); + test_get_queue_info_no_queue_specified (); + test_get_queue_info_unknown_queue (); + test_get_queue_info_invalid_queue (); // indicate we are done testing done_testing (); From 1ef896c63fff740c6cbc76e0160dd4c2435613fb Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Wed, 28 Feb 2024 10:40:19 -0800 Subject: [PATCH 6/9] plugin: remove check_queue_factor () helper func Problem: The check_queue_factor () helper function is no longer used anywhere in the plugin. Remove the definition of check_queue_factor (). --- src/plugins/mf_priority.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/plugins/mf_priority.cpp b/src/plugins/mf_priority.cpp index 17709255..ab63366b 100644 --- a/src/plugins/mf_priority.cpp +++ b/src/plugins/mf_priority.cpp @@ -104,23 +104,6 @@ int64_t priority_calculation (flux_plugin_t *p, } -int check_queue_factor (flux_plugin_t *p, - int queue_factor, - char *queue, - char *prefix = (char *) "") -{ - if (queue_factor == INVALID_QUEUE) { - flux_jobtap_raise_exception (p, FLUX_JOBTAP_CURRENT_JOB, - "mf_priority", 0, - "%sQueue not valid for user: %s", - prefix, queue); - return -1; - } - - return 0; -} - - // Scan the users map and look at each user's default bank to see if any one // of them have a valid bank (i.e one that is not "DNE"; if any of the users do // do have a valid bank, it will return false) From 63c60a03839cdebadd04a3c71fbda20ca0dec4b2 Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Wed, 28 Feb 2024 10:55:04 -0800 Subject: [PATCH 7/9] plugin: move check_map_for_dne_only () Problem: The check_map_for_dne_only () helper function is specific to flux-accounting in that it iterates through the users map and looks to see if the plugin is still waiting on flux-accounting data to be loaded. Thus, it would make more sense for it to be moved to accounting.*. Move the definition for check_map_for_dne_only () to accounting.*. Use auto for the definition of the iterator used in this function. --- src/plugins/accounting.cpp | 14 ++++++++++++++ src/plugins/accounting.hpp | 7 +++++++ src/plugins/mf_priority.cpp | 23 ++--------------------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/plugins/accounting.cpp b/src/plugins/accounting.cpp index d6b188f8..6282724c 100644 --- a/src/plugins/accounting.cpp +++ b/src/plugins/accounting.cpp @@ -173,3 +173,17 @@ int get_queue_info (char *queue, // no queue was specified, so just use a default queue factor return NO_QUEUE_SPECIFIED; } + + +bool check_map_for_dne_only (std::map> + &users, + std::map &users_def_bank) +{ + for (const auto& entry : users) { + auto it = users_def_bank.find(entry.first); + if (it != users_def_bank.end() && it->second != "DNE") + return false; + } + + return true; +} diff --git a/src/plugins/accounting.hpp b/src/plugins/accounting.hpp index 23e158be..0b9bf2f7 100644 --- a/src/plugins/accounting.hpp +++ b/src/plugins/accounting.hpp @@ -89,4 +89,11 @@ int get_queue_info (char *queue, const std::vector &permissible_queues, const std::map &queues); +// check the contents of the users map to see if every user's bank is a +// temporary "DNE" value; if it is, the plugin is still waiting on +// flux-accounting data +bool check_map_for_dne_only (std::map> + &users, + std::map &users_def_bank); + #endif // ACCOUNTING_H diff --git a/src/plugins/mf_priority.cpp b/src/plugins/mf_priority.cpp index ab63366b..656575dd 100644 --- a/src/plugins/mf_priority.cpp +++ b/src/plugins/mf_priority.cpp @@ -104,25 +104,6 @@ int64_t priority_calculation (flux_plugin_t *p, } -// Scan the users map and look at each user's default bank to see if any one -// of them have a valid bank (i.e one that is not "DNE"; if any of the users do -// do have a valid bank, it will return false) -static bool check_map_for_dne_only () -{ - // the users map iterated through in this for-loop, along with the - // users_def_bank map used to look up a user's default bank, are - // both global variables - for (const auto& entry : users) { - auto def_bank_it = users_def_bank.find(entry.first); - if (def_bank_it != users_def_bank.end() && - def_bank_it->second != "DNE") - return false; - } - - return true; -} - - /* * Update the jobspec with the default bank the association used to * submit their job under. @@ -383,7 +364,7 @@ static int priority_cb (flux_plugin_t *p, users, users_def_bank); if (assoc == nullptr) { - if (check_map_for_dne_only () == true) + if (check_map_for_dne_only (users, users_def_bank) == true) // the plugin is still waiting on flux-accounting data to be // loaded in; keep the job in PRIORITY return flux_jobtap_priority_unavail (p, args); @@ -531,7 +512,7 @@ static int validate_cb (flux_plugin_t *p, // the assocation could not be found in the plugin's internal map, // so perform a check to see if the map has any loaded // flux-accounting data before rejecting the job - bool only_dne_data = check_map_for_dne_only (); + bool only_dne_data = check_map_for_dne_only (users, users_def_bank); if (users.empty () || only_dne_data) { add_missing_bank_info (p, h, userid); From 597afd21ec039207032e5467ff225cf852a6d3de Mon Sep 17 00:00:00 2001 From: cmoussa1 Date: Thu, 29 Feb 2024 08:52:52 -0800 Subject: [PATCH 8/9] test: add unit test for check_map_for_dne_only () Problem: There are no unit tests for check_map_for_dne_only (). Add some unit tests. --- src/plugins/test/accounting_test01.cpp | 30 +++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/plugins/test/accounting_test01.cpp b/src/plugins/test/accounting_test01.cpp index 6a9357d4..4ddff822 100644 --- a/src/plugins/test/accounting_test01.cpp +++ b/src/plugins/test/accounting_test01.cpp @@ -189,10 +189,35 @@ static void test_get_queue_info_invalid_queue () } +// ensure false is returned because we have valid flux-accounting data in map +static void test_check_map_dne_false () +{ + bool result = check_map_for_dne_only (users, users_def_bank); + + ok (result == false, "valid flux-accounting data has been loaded"); +} + + +// ensure true is returned because no flux-accounting data is loaded +static void test_check_map_dne_true () +{ + users.clear (); + users_def_bank.clear (); + + Association tmp_user = {"DNE", 0.5, 5, 0, 7, 0, {}, {}, 0, 1}; + add_user_to_map (users, 9999, "DNE", tmp_user); + users_def_bank[9999] = "DNE"; + + bool result = check_map_for_dne_only (users, users_def_bank); + + ok (result == true, "no flux-accounting data has been loaded"); +} + + int main (int argc, char* argv[]) { // declare the number of tests that we plan to run - plan (9); + plan (11); // add users to the test map initialize_map (users); @@ -208,6 +233,9 @@ int main (int argc, char* argv[]) test_get_queue_info_no_queue_specified (); test_get_queue_info_unknown_queue (); test_get_queue_info_invalid_queue (); + test_check_map_dne_false (); + test_check_map_dne_true (); + // indicate we are done testing done_testing (); From e8d8b660c998f180b3fd7b62a57f6ffd52e2ff66 Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Wed, 6 Mar 2024 09:54:38 -0800 Subject: [PATCH 9/9] t1027: add wait-event after updating job Problem: There is a test in t1027-mf-priority-issue376.t that updates the duration of a job but does not wait for it to finish updating before checking its contents in the eventlog, which could cause the test to fail. Add a "wait-event" call to wait for the job after it updates before checking the eventlog. --- t/t1027-mf-priority-issue376.t | 1 + 1 file changed, 1 insertion(+) diff --git a/t/t1027-mf-priority-issue376.t b/t/t1027-mf-priority-issue376.t index 1b407aa5..4c617902 100755 --- a/t/t1027-mf-priority-issue376.t +++ b/t/t1027-mf-priority-issue376.t @@ -54,6 +54,7 @@ test_expect_success 'submit job for testing' ' test_expect_success 'update of duration of pending job works while at active jobs limit' ' flux update $jobid1 duration=1m && + flux job wait-event -vt 10 $jobid1 priority && flux job eventlog $jobid1 \ | grep jobspec-update \ | grep duration=60