Open richtja opened 2 weeks ago
The avocado jobs list
breakage can be seen only when "job results" content is created across multiple versions of Avocado. Example:
$ python3 -m pip install avocado-framework=92.3
...
$ avocado run /bin/true
...
$ python3 -m pip install avocado-framework==108.0
$ avocado jobs list
avocado jobs list
Avocado crashed unexpectedly: 'start'
Traceback (most recent call last):
File "/usr/local/bin/avocado", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/site-packages/avocado/core/main.py", line 86, in main
return app.run()
^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/avocado/core/app.py", line 111, in run
return method(self.parser.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/avocado/plugins/jobs.py", line 189, in run
return self.handle_list_command(results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/avocado/plugins/jobs.py", line 122, in handle_list_command
job["start"],
~~~^^^^^^^^^
KeyError: 'start'
You can also find details in /root/avocado/data/crashes/avocado-traceback-2024-11-12_12:32:41-9yvth7dc.log
The expected behavior here is to not crash, possibly skipping the info that was not obtained.
Now, even with a single version of Avocado generating job results, there's a possible crash with:
$ python3 -m pip install avocado-framework==108.0
$ avocado run /bin/true
JOB ID : 1849848b22a44828889c6b0f2648107fc55264b1
JOB LOG : /root/avocado/job-results/job-2024-11-12T18.14-1849848/job.log
(1/1) /bin/true: STARTED
(1/1) /bin/true: PASS (0.01 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME : 0.51 s
Followed by:
$ avocado jobs show latest
JOB ID : latest
JOB LOG : /root/avocado/job-results/job-2024-11-12T18.14-1849848/job.log
Avocado crashed unexpectedly: 'NoneType' object cannot be interpreted as an integer
Traceback (most recent call last):
File "/usr/local/bin/avocado", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/site-packages/avocado/core/main.py", line 86, in main
return app.run()
^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/avocado/core/app.py", line 111, in run
return method(self.parser.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/avocado/plugins/jobs.py", line 191, in run
return self.handle_show_command(config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/avocado/plugins/jobs.py", line 157, in handle_show_command
self._print_job_tests(results_data.get("tests"))
File "/usr/local/lib/python3.12/site-packages/avocado/plugins/jobs.py", line 60, in _print_job_tests
end = datetime.fromtimestamp(test.get("actual_end", test.get("end")))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer
You can also find details in /root/avocado/data/crashes/avocado-traceback-2024-11-12_18:14:42-6o_shh4c.log
Hi @clebergnu, thanks for the testing. So IIUIC the avocado jobs show latest
is not some corner case with corrupted test results, it just simply doesn't work on avocado 108. Therefore, I will move this into current milestone as any other normal bug.
Describe the bug The
avocado jobs
command makes avocado crash. Boutavocado jobs list
andavocado jobs show
is broken.Steps to reproduce Just run
avocado jobs list
oravocado jobs show latest
Expected behavior Avocado will provide useful information, and it won't crash.
Current behavior
System information (please complete the following information):