Error message opaque when .testrepository files are unreadable

Bug #1348970 reported by Monty Taylor on 2014-07-26
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Testrepository
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

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
Victor Stinner (victor-stinner) 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  Edit
Everyone can see this information.

Other bug subscribers