From ec933eef47ff0b053dde5ed863b3ff8722018ac6 Mon Sep 17 00:00:00 2001 From: Christopher Moussa Date: Thu, 15 Jul 2021 12:44:50 -0700 Subject: [PATCH] t: add "max_jobs" key-value pair to fake payloads --- t/t1001-mf-priority-basic.t | 4 ++-- t/t1002-mf-priority-small-no-tie.t | 14 +++++++------- t/t1003-mf-priority-small-tie.t | 16 ++++++++-------- t/t1004-mf-priority-small-tie-all.t | 18 +++++++++--------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/t/t1001-mf-priority-basic.t b/t/t1001-mf-priority-basic.t index 4daac3915..ff1b4c5a4 100755 --- a/t/t1001-mf-priority-basic.t +++ b/t/t1001-mf-priority-basic.t @@ -45,9 +45,9 @@ test_expect_success 'create fake_payload.py' ' username = getpass.getuser() userid = pwd.getpwnam(username).pw_uid # create a JSON payload - data = {"userid": str(userid), "bank": "account3", "default_bank": "account3", "fairshare": "0.45321"} + data = {"userid": str(userid), "bank": "account3", "default_bank": "account3", "fairshare": "0.45321", "max_jobs": "3"} flux.Flux().rpc("job-manager.mf_priority.rec_update", data).get() - data = {"userid": str(userid), "bank": "account2", "default_bank": "account3", "fairshare": "0.11345"} + data = {"userid": str(userid), "bank": "account2", "default_bank": "account3", "fairshare": "0.11345", "max_jobs": "3"} flux.Flux().rpc("job-manager.mf_priority.rec_update", data).get() EOF ' diff --git a/t/t1002-mf-priority-small-no-tie.t b/t/t1002-mf-priority-small-no-tie.t index 22470ceb0..751ca4c4a 100755 --- a/t/t1002-mf-priority-small-no-tie.t +++ b/t/t1002-mf-priority-small-no-tie.t @@ -25,13 +25,13 @@ test_expect_success 'create a group of users with unique fairshare values' ' cat <<-EOF >fake_small_no_tie.json { "users" : [ - {"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.285714"}, - {"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.142857"}, - {"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "0.428571"}, - {"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.714286"}, - {"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.571429"}, - {"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "1.0"}, - {"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.857143"} + {"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.285714", "max_jobs": "5"}, + {"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.142857", "max_jobs": "5"}, + {"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "0.428571", "max_jobs": "5"}, + {"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.714286", "max_jobs": "5"}, + {"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.571429", "max_jobs": "5"}, + {"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "1.0", "max_jobs": "5"}, + {"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.857143", "max_jobs": "5"} ] } EOF diff --git a/t/t1003-mf-priority-small-tie.t b/t/t1003-mf-priority-small-tie.t index 4ef3eb0e3..619d4bbfc 100755 --- a/t/t1003-mf-priority-small-tie.t +++ b/t/t1003-mf-priority-small-tie.t @@ -25,14 +25,14 @@ test_expect_success 'create a group of users with some ties in fairshare values' cat <<-EOF >fake_small_tie.json { "users" : [ - {"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.5"}, - {"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.5"}, - {"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "0.75"}, - {"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.5"}, - {"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.5"}, - {"userid": "5023", "bank": "account2", "default_bank": "account2", "fairshare": "0.75"}, - {"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "1.0"}, - {"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.875"} + {"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.5", "max_jobs": "5"}, + {"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.5", "max_jobs": "5"}, + {"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "0.75", "max_jobs": "5"}, + {"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.5", "max_jobs": "5"}, + {"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.5", "max_jobs": "5"}, + {"userid": "5023", "bank": "account2", "default_bank": "account2", "fairshare": "0.75", "max_jobs": "5"}, + {"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "1.0", "max_jobs": "5"}, + {"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.875", "max_jobs": "5"} ] } EOF diff --git a/t/t1004-mf-priority-small-tie-all.t b/t/t1004-mf-priority-small-tie-all.t index 32cc1b904..964cd4f77 100755 --- a/t/t1004-mf-priority-small-tie-all.t +++ b/t/t1004-mf-priority-small-tie-all.t @@ -25,15 +25,15 @@ test_expect_success 'create a group of users with many ties in fairshare values' cat <<-EOF >fake_small_tie_all.json { "users" : [ - {"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.666667"}, - {"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.666667"}, - {"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "1"}, - {"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.666667"}, - {"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.666667"}, - {"userid": "5023", "bank": "account2", "default_bank": "account2", "fairshare": "1"}, - {"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "0.666667"}, - {"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.666667"}, - {"userid": "5033", "bank": "account3", "default_bank": "account3", "fairshare": "1"} + {"userid": "5011", "bank": "account1", "default_bank": "account1", "fairshare": "0.666667", "max_jobs": "5"}, + {"userid": "5012", "bank": "account1", "default_bank": "account1", "fairshare": "0.666667", "max_jobs": "5"}, + {"userid": "5013", "bank": "account1", "default_bank": "account1", "fairshare": "1", "max_jobs": "5"}, + {"userid": "5021", "bank": "account2", "default_bank": "account2", "fairshare": "0.666667", "max_jobs": "5"}, + {"userid": "5022", "bank": "account2", "default_bank": "account2", "fairshare": "0.666667", "max_jobs": "5"}, + {"userid": "5023", "bank": "account2", "default_bank": "account2", "fairshare": "1", "max_jobs": "5"}, + {"userid": "5031", "bank": "account3", "default_bank": "account3", "fairshare": "0.666667", "max_jobs": "5"}, + {"userid": "5032", "bank": "account3", "default_bank": "account3", "fairshare": "0.666667", "max_jobs": "5"}, + {"userid": "5033", "bank": "account3", "default_bank": "account3", "fairshare": "1", "max_jobs": "5"} ] } EOF