File: test_execute_wait.py

package info (click to toggle)
python-parsl 2025.01.13%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,072 kB
  • sloc: python: 23,817; makefile: 349; sh: 276; ansic: 45
file content (35 lines) | stat: -rw-r--r-- 880 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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