-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move execute_wait from vestigial LocalChannel into parsl.utils (#3705)
# 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
- Loading branch information
1 parent
1f583af
commit 90d4a86
Showing
9 changed files
with
78 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pytest | ||
|
||
from parsl.utils import execute_wait | ||
|
||
|
||
@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" | ||
|
||
|
||
@pytest.mark.local | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters