From 400bc5e6b6d77d96836950d30a673bd3bc1c0080 Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Fri, 23 Feb 2024 21:08:25 -0800 Subject: [PATCH] contest: vmksft-p: number vms from 1 VM IDs are what we start from + 1, so the first VM in each thread will have ID number 2: vm-start-thr0-2 vm-start-thr1-2 vm-stop-thr0-2 vm-stop-thr1-2 (the "-2" at the end). This is pretty odd. Start from 0, like thread ID. Note that the initial value of vm_id is the "previous ID", so init to -1. Signed-off-by: Jakub Kicinski --- contest/remote/lib/vm.py | 2 +- contest/remote/vmksft-p.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contest/remote/lib/vm.py b/contest/remote/lib/vm.py index dd17dda..8fb9f07 100644 --- a/contest/remote/lib/vm.py +++ b/contest/remote/lib/vm.py @@ -406,7 +406,7 @@ def bash_prev_retcode(self): def new_vm(results_path, vm_id, thr=None, vm=None, config=None, cwd=None): thr_pfx = f"thr{thr}-" if thr is not None else "" if vm is None: - vm = VM(config, vm_name=f"{thr_pfx}{vm_id}") + vm = VM(config, vm_name=f"{thr_pfx}{vm_id + 1}") # For whatever reason starting sometimes hangs / crashes i = 0 while True: diff --git a/contest/remote/vmksft-p.py b/contest/remote/vmksft-p.py index ef35855..25b9ca7 100755 --- a/contest/remote/vmksft-p.py +++ b/contest/remote/vmksft-p.py @@ -114,7 +114,7 @@ def _parse_nested_tests(full_run): def _vm_thread(config, results_path, thr_id, hard_stop, in_queue, out_queue): target = config.get('ksft', 'target') vm = None - vm_id = 1 + vm_id = -1 while True: try: