-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor fixes to full_wlm tests #283
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,15 +47,19 @@ def test_launch_orc_auto_batch(fileutils, wlmutils): | |
# batch = False to launch on existing allocation | ||
network_interface = wlmutils.get_test_interface() | ||
orc = exp.create_database( | ||
6780, batch=True, interface=network_interface, single_cmd=False | ||
wlmutils.get_test_port(), batch=True, interface=network_interface, single_cmd=False | ||
) | ||
|
||
test_account = wlmutils.get_test_account() | ||
if test_account: | ||
orc.batch_settings.set_account(test_account) | ||
if wlmutils.get_test_launcher() == "lsf": | ||
orc.batch_settings.set_account(wlmutils.get_test_account()) | ||
orc.batch_settings.set_walltime("00:02") | ||
else: | ||
orc.batch_settings.set_walltime("00:02:00") | ||
if wlmutils.get_test_launcher() == "cobalt": | ||
orc.batch_settings.set_account(wlmutils.get_test_account()) | ||
orc.batch_settings.set_queue("debug-flat-quad") | ||
orc.batch_settings.set_walltime("00:02:00") | ||
|
||
orc.set_path(test_dir) | ||
|
||
exp.start(orc, block=True) | ||
|
@@ -83,19 +87,22 @@ def test_launch_cluster_orc_batch_single(fileutils, wlmutils): | |
# batch = False to launch on existing allocation | ||
network_interface = wlmutils.get_test_interface() | ||
orc = exp.create_database( | ||
6780, db_nodes=3, batch=True, interface=network_interface, single_cmd=True | ||
wlmutils.get_test_port(), db_nodes=3, batch=True, interface=network_interface, single_cmd=True | ||
) | ||
|
||
test_account = wlmutils.get_test_account() | ||
if test_account: | ||
orc.batch_settings.set_account(test_account) | ||
if wlmutils.get_test_launcher() == "lsf": | ||
orc.batch_settings.set_account(wlmutils.get_test_account()) | ||
orc.batch_settings.set_walltime("00:02") | ||
else: | ||
orc.batch_settings.set_walltime("00:02:00") | ||
if wlmutils.get_test_launcher() == "cobalt": | ||
# As Cobalt won't allow us to run two | ||
# jobs in the same debug queue, we need | ||
# to make sure the previous test's one is over | ||
time.sleep(120) | ||
orc.batch_settings.set_account(wlmutils.get_test_account()) | ||
orc.batch_settings.set_queue("debug-flat-quad") | ||
orc.batch_settings.set_walltime("00:02:00") | ||
orc.set_path(test_dir) | ||
|
||
exp.start(orc, block=True) | ||
|
@@ -123,19 +130,21 @@ def test_launch_cluster_orc_batch_multi(fileutils, wlmutils): | |
# batch = False to launch on existing allocation | ||
network_interface = wlmutils.get_test_interface() | ||
orc = exp.create_database( | ||
6780, db_nodes=3, batch=True, interface=network_interface, single_cmd=False | ||
wlmutils.get_test_port(), db_nodes=3, batch=True, interface=network_interface, single_cmd=False | ||
) | ||
test_account = wlmutils.get_test_account() | ||
if test_account: | ||
orc.batch_settings.set_account(test_account) | ||
if wlmutils.get_test_launcher() == "lsf": | ||
orc.batch_settings.set_account(wlmutils.get_test_account()) | ||
orc.batch_settings.set_walltime("00:03") | ||
else: | ||
orc.batch_settings.set_walltime("00:03:00") | ||
if wlmutils.get_test_launcher() == "cobalt": | ||
# As Cobalt won't allow us to run two | ||
# jobs in the same debug queue, we need | ||
# to make sure the previous test's one is over | ||
time.sleep(120) | ||
orc.batch_settings.set_account(wlmutils.get_test_account()) | ||
orc.batch_settings.set_queue("debug-flat-quad") | ||
orc.batch_settings.set_walltime("00:03:00") | ||
orc.set_path(test_dir) | ||
|
||
exp.start(orc, block=True) | ||
|
@@ -160,19 +169,22 @@ def test_launch_cluster_orc_reconnect(fileutils, wlmutils): | |
|
||
# batch = False to launch on existing allocation | ||
network_interface = wlmutils.get_test_interface() | ||
orc = exp.create_database(6780, db_nodes=3, batch=True, interface=network_interface) | ||
orc = exp.create_database(wlmutils.get_test_port(), db_nodes=3, batch=True, interface=network_interface) | ||
orc.set_path(test_dir) | ||
|
||
test_account = wlmutils.get_test_account() | ||
if test_account: | ||
orc.batch_settings.set_account(test_account) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of scope for this PR, more-so a note to myself for a potential Iirc, for Is this not the case for all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be, indeed. I updated LSF, which was the only one with a slightly different behavior (due to the fact that accounts are always needed on LSF). |
||
if wlmutils.get_test_launcher() == "lsf": | ||
orc.batch_settings.set_account(wlmutils.get_test_account()) | ||
orc.batch_settings.set_walltime("00:03") | ||
else: | ||
orc.batch_settings.set_walltime("00:03:00") | ||
if wlmutils.get_test_launcher() == "cobalt": | ||
# As Cobalt won't allow us to run two | ||
# jobs in the same debug queue, we need | ||
# to make sure the previous test's one is over | ||
time.sleep(120) | ||
orc.batch_settings.set_account(wlmutils.get_test_account()) | ||
orc.batch_settings.set_queue("debug-flat-quad") | ||
orc.batch_settings.set_walltime("00:03:00") | ||
|
||
exp.start(orc, block=True) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,17 +36,23 @@ | |
pytestmark = pytest.mark.skip(reason="Test is only for Slurm WLM systems") | ||
|
||
|
||
def test_get_release_allocation(): | ||
def test_get_release_allocation(wlmutils): | ||
"""test slurm interface for obtaining allocations""" | ||
alloc = slurm.get_allocation(nodes=1, time="00:05:00") | ||
account = wlmutils.get_test_account() | ||
if not account: | ||
account = None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels a bit like an anti-pattern. Should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come you always have such good ideas. Indeed, updated. |
||
alloc = slurm.get_allocation(nodes=1, time="00:05:00", account=account) | ||
time.sleep(5) # give slurm a rest | ||
slurm.release_allocation(alloc) | ||
|
||
|
||
def test_get_release_allocation_w_options(): | ||
def test_get_release_allocation_w_options(wlmutils): | ||
"""test slurm interface for obtaining allocations""" | ||
options = {"ntasks-per-node": 1} | ||
alloc = slurm.get_allocation(nodes=1, time="00:05:00", options=options) | ||
account = wlmutils.get_test_account() | ||
if not account: | ||
account = None | ||
alloc = slurm.get_allocation(nodes=1, time="00:05:00", options=options, account=account) | ||
time.sleep(5) # give slurm a rest | ||
slurm.release_allocation(alloc) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for this PR, more-so just a note to myself for a potential addition to
BatchSettings
class:This feels like there is probably a way to unify these
set_walltime
calls so that we do not need to jump based on launcher. Maybe something akin toRunSettings.set_time
.Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of a sudden, you reminded me that we can actually specify time like that in LSF, because we convert it to
hh:mm
format on the fly. Removing outdated lines.