Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
N nxdtest
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedi
  • nxdtest
  • Merge requests
  • !16

Merged
Created Jan 24, 2022 by Kirill Smelkov@kirrOwner

Cancel test run on SIGINT/SIGTERM

  • Overview 9
  • Commits 4
  • Changes 5

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

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: y/sigint
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7