We're updating the issue view to help you get more done. 

PTL test case fails before setUp function with AttributeError

Description

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 pbs_cray_smoke_test.py.

I got error as below:

File "/tmp/ptl_test/lib/python2.7/site-packages/nose/proxy.py", line 131, in addError
plugins.addError(self.test, err)
File "/tmp/ptl_test/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in call
return self.call(*arg, **kw)
File "/tmp/ptl_test/lib/python2.7/site-packages/nose/plugins/manager.py", line 167, in simple
result = meth(*arg, **kw)
File "/tmp/ptl_test/lib/python2.7/site-packages/ptl/utils/plugins/ptl_test_db.py", 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/ptl_test_db.py", line 1628, in write
self.__write_test_data(data['testdata'])
File "/tmp/ptl_test/lib/python2.7/site-packages/ptl/utils/plugins/ptl_test_db.py", 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/ptl_report_json.py", 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 pbs_cray_suspend_resume.py 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

None

Status

Assignee

Shilpa Kodli

Reporter

Shilpa Kodli

Severity

None

OS

None

Start Date

None

Pull Request URL

Story Points

1

Components

Priority

Low