Skip to content
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

Move execute_wait from vestigial LocalChannel into parsl.utils #3705

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

benclifford
Copy link
Collaborator

Description

This moves the execute_wait functionality previously provided by LocalChannel into parsl.utils, as part of #3515. LocalChannel.execute_wait did not reference self so it already basically behaved as a function rather than a method.

This leaves LocalChannel as solely a place for script_directory, which will be untangled in a subsequent PR.

Changed Behaviour

none

Type of change

  • Code maintenance/cleanup

@benclifford benclifford changed the title Move execute_wait from vestigial channels into parsl.utils Move execute_wait from vestigial LocalChannel into parsl.utils Nov 26, 2024
Comment on lines +6 to +18
@pytest.mark.local
def test_env():
''' Regression testing for issue #27
'''

rc, stdout, stderr = execute_wait("env", 1)

stdout = stdout.split('\n')
x = [s for s in stdout if s.startswith("PATH=")]
assert x, "PATH not found"

x = [s for s in stdout if s.startswith("HOME=")]
assert x, "HOME not found"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this is just moving the test, but I also don't understand what it's testing. What does this have to do with the referenced issue #27, which looks related to documentation?

Meanwhile, PATH/HOME not found is restating the logic. Is the goal to just ensure we're executing something successfully? If so, something like Did not execute: canary value missing! might be a better assertion message. Or is the environment actually important to verify? I don't see any reference to a special environment in execute_wait ... ?

And of course, a simplification of the test itself might be:

assert any(s.startswith("PATH=") for s in stdout), "Bad environment!"
...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #27 is a red herring -- around 2017 there was a somewhat misguided activity to separate out the provider layer into its own github repo called libsubmit. This refers to libsubmit issue 27: Parsl/libsubmit#27.

Go back far enough in history and the commit that introduces this test does stuff in the libsubmit/ subdirectory from the subsequently re-merged libsubmit history.

I'm not going to tidy these tests any time soon - this PR sequence really is meant to be moving, deleting and then moving on.

Comment on lines +22 to +35
def test_large_output_2210():
"""Regression test for #2210.
execute_wait was hanging if the specified command gave too
much output, due to a race condition between process exiting and
pipes filling up.
"""

# this will output 128kb of stdout
execute_wait("yes | dd count=128 bs=1024", walltime=60)

# if this test fails, execute_wait should raise a timeout
# exception.

# The contents out the output is not verified by this test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar question (and understanding of simply moving) as to the progeny of this test, though it's utility is more clear to me.

Meanwhile I'm unsure of the value of these particular numbers. Why stop at "only" 128K? If it's going to hang, perhaps we make sure it does so we catch it, nominally with a much higher value. 1G would be overkill enough: yes | dd count=1K bs=1M

Similarly, if we're going to fail, this should fail super quick, why wait for a full minute? 5s should be beyond plenty of time, no?

@benclifford benclifford added this pull request to the merge queue Dec 3, 2024
Merged via the queue into master with commit 90d4a86 Dec 3, 2024
7 checks passed
@benclifford benclifford deleted the benc-3515-execute-wait branch December 3, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants