Error message opaque when .testrepository files are unreadable

Bug #1348970 reported by Monty Taylor
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Testrepository
Triaged
High
Unassigned

Bug Description

If the files in .testrepository are unreadable for some reason (such as tests having been written by root mode 600) then testr slowest unhelpfully prints:

local variable 'run_subunit_content' referenced before assignment

Revision history for this message
Robert Collins (lifeless) wrote :

could you reproduce this with TESTR_PDB=1 and get a full backtrace? Thanks!

Changed in testrepository:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Victor Stinner (vstinner) wrote :

Hi, I got the same error. Traceback:

vstinner@d-bstcld-0000[dev45][aub] ~/ci-cloudwatt % TESTR_PDB=1 testr run --subunit xxx
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./tempest/test_discover} --list
  File "/usr/lib/python2.7/dist-packages/testrepository/commands/__init__.py", line 143, in execute
    result = self.run()
  File "/usr/lib/python2.7/dist-packages/testrepository/commands/load.py", line 134, in run
    previous_run = repo.get_latest_run()
  File "/usr/lib/python2.7/dist-packages/testrepository/repository/__init__.py", line 99, in get_latest_run
    return self.get_test_run(self.latest_id())
  File "/usr/lib/python2.7/dist-packages/testrepository/repository/file.py", line 136, in get_test_run
    return _DiskRun(run_id, run_subunit_content)

> /usr/lib/python2.7/dist-packages/testrepository/repository/file.py(136)get_test_run()
-> return _DiskRun(run_id, run_subunit_content)

(Pdb) where
  /usr/lib/python2.7/dist-packages/testrepository/commands/__init__.py(143)execute()
-> result = self.run()
  /usr/lib/python2.7/dist-packages/testrepository/commands/load.py(134)run()
-> previous_run = repo.get_latest_run()
  /usr/lib/python2.7/dist-packages/testrepository/repository/__init__.py(99)get_latest_run()
-> return self.get_test_run(self.latest_id())
> /usr/lib/python2.7/dist-packages/testrepository/repository/file.py(136)get_test_run()

Changed in testrepository:
importance: Medium → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.