Skip to content

Handle user interrupt in 'netlab test' - #3878

Merged
ipspace merged 2 commits into
devfrom
netlab-test-interrupt
Sep 10, 2026
Merged

Handle user interrupt in 'netlab test'#3878
ipspace merged 2 commits into
devfrom
netlab-test-interrupt

Conversation

@ipspace

@ipspace ipspace commented Sep 10, 2026

Copy link
Copy Markdown
Owner

No description provided.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new Ctrl+C handling currently triggers an interactive prompt during cleanup (input()), which can block the intended “user interrupt” exit path.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread netsim/cli/test.py
Comment on lines +110 to +113
except KeyboardInterrupt:
log.error(f'User interrupted the {cmd} command',category=log.FatalError,module='test')
cleanup_working_directory(args,True)
sys.exit(1)
Comment thread netsim/cli/test.py
if args.verbose:
print("... done, test completed\n")

def run_netlab_command(cmd: str, args: argparse.Namespace) -> typing.Any:
@ipspace
ipspace merged commit c948432 into dev Sep 10, 2026
9 checks passed
@ipspace
ipspace deleted the netlab-test-interrupt branch September 10, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants