b8eacc441850d8f636e70958d1c5c0fce2c1a745,unittests/test_schedulers.py,,test_cancel,#Any#Any#,319

Before Change


def test_cancel(make_job, exec_ctx):
    minimal_job = make_job(sched_access=exec_ctx.access)
    prepare_job(minimal_job, "sleep 30")
    t_job = datetime.now()
    minimal_job.submit()
    minimal_job.cancel()

    // We give some time to the local scheduler for the TERM signal to be
    // delivered; if we poll immediately, the process may have not been killed
    // yet, and the scheduler will assume that it"s ignoring its signal, then
    // wait for a grace period and send a KILL signal, which is not what we
    // want to test here.
    time.sleep(0.01)

    minimal_job.wait()
    t_job = datetime.now() - t_job
    assert minimal_job.finished()
    assert t_job.total_seconds() < 30

After Change


def test_cancel(make_job, exec_ctx):
    minimal_job = make_job(sched_access=exec_ctx.access)
    prepare_job(minimal_job, "sleep 30")
    t_job = time.time()
    minimal_job.submit()
    minimal_job.cancel()

    // We give some time to the local scheduler for the TERM signal to be
    // delivered; if we poll immediately, the process may have not been killed
    // yet, and the scheduler will assume that it"s ignoring its signal, then
    // wait for a grace period and send a KILL signal, which is not what we
    // want to test here.
    time.sleep(0.01)

    minimal_job.wait()
    t_job = time.time() - t_job
    assert minimal_job.finished()
    assert t_job < 30
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: eth-cscs/reframe
Commit Name: b8eacc441850d8f636e70958d1c5c0fce2c1a745
Time: 2020-12-07
Author: karakasis@cscs.ch
File Name: unittests/test_schedulers.py
Class Name:
Method Name: test_cancel


Project Name: eth-cscs/reframe
Commit Name: b8eacc441850d8f636e70958d1c5c0fce2c1a745
Time: 2020-12-07
Author: karakasis@cscs.ch
File Name: unittests/test_schedulers.py
Class Name:
Method Name: test_cancel


Project Name: eth-cscs/reframe
Commit Name: 655c6d51bf741b432dab20261713df1c84df973c
Time: 2020-11-06
Author: karakasis@cscs.ch
File Name: unittests/test_schedulers.py
Class Name:
Method Name: test_cancel_with_grace


Project Name: eth-cscs/reframe
Commit Name: 655c6d51bf741b432dab20261713df1c84df973c
Time: 2020-11-06
Author: karakasis@cscs.ch
File Name: unittests/test_schedulers.py
Class Name:
Method Name: test_cancel_term_ignore