Bug 101503

Summary: Piglit exits with "invalid literal for int() with base 10: '19225.json"
Product: piglit Reporter: Hi-Angel <Hi-Angel>
Component: infrastructureAssignee: Dylan Baker <baker.dylan.c>
Status: RESOLVED FIXED QA Contact: Piglit Mailing List <piglit>
Severity: normal    
Priority: medium CC: hector.edmundox.ramirez.gomez
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Hi-Angel 2017-06-19 17:44:24 UTC
For running tests at some point it exits with error:

	$ LD_LIBRARY_PATH=/home/constantine/Projects/mesa/lib LIBGL_DRIVERS_PATH=/home/constantine/Projects/mesa/lib/gallium ./piglit run -p gbm -c tests/gpu.py results/master-d69f82c3c940467
	[19226/26003] skip: 10067, pass: 9109, warn: 5, fail: 40, crash: 5     
	Traceback (most recent call last):                                
	  File "./piglit", line 174, in <module>
		main()
	  File "./piglit", line 170, in main
		sys.exit(runner(args))
	  File "/home/constantine/Projects/piglit/framework/exceptions.py", line 51, in _inner
		func(*args, **kwargs)
	  File "/home/constantine/Projects/piglit/framework/programs/run.py", line 360, in run
		backend.finalize({'time_elapsed': time_elapsed.to_json()})
	  File "/home/constantine/Projects/piglit/framework/backends/json.py", line 130, in finalize
		key=lambda p: int(os.path.splitext(p)[0]))
	  File "/home/constantine/Projects/piglit/framework/backends/json.py", line 130, in <lambda>
		key=lambda p: int(os.path.splitext(p)[0]))
	ValueError: invalid literal for int() with base 10: '19225.json'
	$ cat results/master-d69f82c3c940467/tests/19225.json
	{"spec@!opengl 1.1@texsubimage-unpack": {"__type__": "TestResult", "command": "", "environment": "", "err": "", "out": "", "result": "incomplete", "returncode": null, "subtests": {"__type__": "Subtests"}, "time": {"start": 0.0, "end": 0.0, "__type__": "TimeAttribute"}, "exception": null, "traceback": null, "dmesg": "", "pid": []}}

Last time I ran piglit was ≈month ago, it was working fine. I don't remember changing anything till today, so I suspect some update to my system broke it. Just a guess though. After update to HEAD the error persist (the traceback from the HEAD).

I don't know how to run this specific 19225 test separately, ideas are welcome.

	$ python --version                            
	Python 3.6.1
Comment 1 Dylan Baker 2017-06-20 18:10:38 UTC

That is a very interesting bug. I'm not sure exactly how you hit that.
Essentially the python framework is trying to split the '.json' off the end and
turn the fist part into a number rather than a string, and failing. 

What does `ls results/master-d69f82c3c940467/tests/19225.json*` return?
Comment 2 Hi-Angel 2017-06-20 18:11:50 UTC
	$ ls results/master-d69f82c3c940467/tests/19225.json*
	results/master-d69f82c3c940467/tests/19225.json
	results/master-d69f82c3c940467/tests/19225.json.tmp
Comment 3 Dylan Baker 2017-06-21 16:01:13 UTC

Ahhhhhh. Okay. That .tmp file is what's tripping it up.
Comment 4 Hi-Angel 2017-06-21 16:04:58 UTC
(In reply to Dylan Baker from comment #3)
> 
> Ahhhhhh. Okay. That .tmp file is what's tripping it up.

Well, other tmp files are probably fine

	$ ls results/master-d69f82c3c940467/tests/*.tmp      
	results/master-d69f82c3c940467/tests/19218.json.tmp
	results/master-d69f82c3c940467/tests/19222.json.tmp
	results/master-d69f82c3c940467/tests/19224.json.tmp
	results/master-d69f82c3c940467/tests/19225.json.tmp
Comment 5 Hi-Angel 2017-06-22 05:28:04 UTC
What are they anyway? Will they may be not appear again if I remove and redownload whole piglit repo dir?
Comment 6 Dylan Baker 2017-06-22 21:26:02 UTC
Each of those json files is the result of a single test. Because piglit tries to make writes atomic when the test starts a <number>.json file is created that contains the PID of the test and the status "incomplete", when the test completes a new file <number>.json.tmp is created and moved over the original results.

What's happening (I think) is that piglit is dying before the .tmp file is moved over the original file. It should be fairly straight forward to patch it, I'll link the patch here.

In the mean time if you run `rm results/.../*.tmp`, and then `piglit summary aggregate results/...` (with ... as your full path) you can view the results as is.
Comment 7 Dylan Baker 2017-06-22 22:06:52 UTC
This series fixes the issue: https://patchwork.freedesktop.org/series/26257/
Comment 8 Hi-Angel 2017-06-23 14:13:12 UTC
Thank you, yes, it seems to work! I'm not sure though if I can send my t-b because, for irrelevant reasons (GPU lockup), I can't finish a test run. However the 19225 test passes.
Comment 9 Hi-Angel 2017-06-23 19:51:10 UTC
I managed to finish a test run (the lockup intermittent), so I sent t-b into ML.
Comment 10 Dylan Baker 2017-07-21 18:04:34 UTC
*** Bug 101872 has been marked as a duplicate of this bug. ***
Comment 11 Dylan Baker 2018-02-28 22:48:49 UTC
I'm pretty sure the fix for this landed a long time ago. Feel free to reopen if not.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.