kill-on-timeout.should 409 Bytes
Newer Older
Mikael Salson's avatar
Mikael Salson committed
1 2
# when task takes too many time it should be killed by should.py

3
!EXIT_CODE: 1
Mikael Salson's avatar
Mikael Salson committed
4
./should --timeout 1 demo/tests/timeout.should
5

Mikael Salson's avatar
Mikael Salson committed
6
# Check that the script is not running anymore
7
!EXIT_CODE: 0
Mikael Salson's avatar
Mikael Salson committed
8 9 10 11 12 13 14 15 16 17
ps awux | grep  'seq 1 10.*sleep' | grep -v grep || echo "not found"

$ The task must time out
1: timeout after

$ The elapsed time must be close to the timeout
r1:^1.[0-9]+s

$ The task must not run anymore
1:not found