PTL test case fails before setUp function with AttributeError


If we have erroneous code(Function which fails with error) inside class in a test suite, then other test cases also fail when it is run with -t option.

This is observed on Cray platform.

This machine doesn't have apstat installed in it and all Cray related test suits fail if apstat doesn't exist.

In my case, I was running

I got error as below:

File "/tmp/ptl_test/lib/python2.7/site-packages/nose/", line 131, in addError
plugins.addError(self.test, err)
File "/tmp/ptl_test/lib/python2.7/site-packages/nose/plugins/", line 99, in call
return*arg, **kw)
File "/tmp/ptl_test/lib/python2.7/site-packages/nose/plugins/", line 167, in simple
result = meth(*arg, **kw)
File "/tmp/ptl_test/lib/python2.7/site-packages/ptl/utils/plugins/", line 1801, in addError
self._dbconn.write(self._create_data(test, err, 'ERROR'))
File "/tmp/ptl_test/lib/python2.7/site-packages/ptl/utils/plugins/", line 1628, in write
File "/tmp/ptl_test/lib/python2.7/site-packages/ptl/utils/plugins/", line 1620, in __write_test_data
jsondata = self.res_data.get_json(data=data, prev_data=jdata)
File "/tmp/ptl_test/lib/python2.7/site-packages/ptl/utils/plugins/", line 69, in get_json
'run_id': data['start_time'].strftime('%s'),
AttributeError: 'int' object has no attribute 'strftime'

After further anaysis it is found that test suite has CrayUtils function called inside class and this class internally runs apstat command which was failing before even starting of actual test case to be run.

Acceptance Criteria



Shilpa Kodli
March 7, 2019, 9:21 AM

This issue is seen only on Cray platform as it was booted to a different image other than default one which didn't have apstat installed on it.
Now this issue is not reproducible but still PTL has bug. Going forward with the fix.

Your pinned fields
Click on the next to a field label to start pinning.


Shilpa Kodli


Shilpa Kodli

Pull Request URL