Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
N
nxdtest
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • nexedi
  • nxdtest
  • Merge Requests
  • !16

Merged
Opened Jan 24, 2022 by Kirill Smelkov@kirr
  • Report abuse
Report abuse

Cancel test run on SIGINT/SIGTERM

In addition to canceling test run is master tells us to do so, also cancel the run if interrupted or terminated.

With the following sample .nxdtest

TestCase('sleep', ['sleep', '10'])

before the patch it does not react to CTRL+C:

$ nxdtest
...
>>> sleep
$ sleep 10
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C# ran 0 test cases.   <-- no reaction to CTRL+C, finishes after 10 seconds
Traceback (most recent call last):
  File "/home/kirr/src/tools/go/py3.venv2/bin/nxdtest", line 33, in <module>
    sys.exit(load_entry_point('nxdtest', 'console_scripts', 'nxdtest')())
  File "/home/kirr/src/tools/go/py3.venv2/lib/python3.9/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/home/kirr/src/tools/go/pygolang-master/golang/__init__.py", line 103, in _
    return f(*argv, **kw)
  File "/home/kirr/src/wendelin/nxdtest/nxdtest/__init__.py", line 339, in main
    wg.wait()
KeyboardInterrupt

after the patch:

$ nxdtest
...
>>> sleep
$ sleep 10
^C# Interrupt					<-- prompt reaction to CTRL+C
# stopping due to cancel
# leaked pid=188877 'sleep' ['sleep', '10']
error   sleep   1.030s  # 1t 1e 0f 0s
# test run canceled
# ran 1 test case:  1·error

Needs pygolang!17 (merged) to work.

/cc @jerome

  • Discussion 9
  • Commits 4
  • Changes 5
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: nexedi/nxdtest!16

Revert this commit

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this commit

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备14008524号