Issue #188 resolved

AssertionError: Missing content in out/showtraceout.txt: 'regular CTracer' errors when running alltests.sh

Marc Abramowitz
created an issue

{{{ [last: 0] marca@scml-marca:~/dev/hg-repos/coverage_msabramo_tox$ PYTHONPATH=test/eggsrc ./alltests.sh Testing in ../ve === Python 2.5.4 with C tracer (/Users/marca/dev/hg-repos/ve/25/bin/python) === ............................................................................................................................................................................................................................F................................................................................................. ====================================================================== FAIL: test/farm/run/run_timid.py


Traceback (most recent call last): File "/Users/marca/dev/hg-repos/ve/25/lib/python2.5/site-packages/nose-1.1.2-py2.5.egg/nose/case.py", line 197, in runTest self.test(*self.arg) File "/Users/marca/dev/hg-repos/coverage_msabramo_tox/test/test_farm.py", line 81, in call execfile(self.runpy, glo) File "run_timid.py", line 24, in <module> File "/Users/marca/dev/hg-repos/coverage_msabramo_tox/test/test_farm.py", line 287, in contains assert s in text, "Missing content in %s: %r" % (filename, s) AssertionError: AssertionError: Missing content in out/showtraceout.txt: 'regular CTracer' -------------------- >> begin captured stdout << --------------------- regular PyTracer timid PyTracer

--------------------- >> end captured stdout << ----------------------


Ran 318 tests in 22.949s

FAILED (failures=1) === Python 2.5.4 with Python tracer (/Users/marca/dev/hg-repos/ve/25/bin/python) === ..............................................................................................................................................................................................................................................................................................................................


Ran 318 tests in 22.712s

OK === CPython 2.6.8 with C tracer (/Users/marca/dev/hg-repos/ve/26/bin/python) === .............................................................................................................................................................................................................................F.................................................................................................... ====================================================================== FAIL: test/farm/run/run_timid.py


Traceback (most recent call last): File "/Users/marca/dev/hg-repos/ve/26/lib/python2.6/site-packages/nose-1.1.2-py2.6.egg/nose/case.py", line 197, in runTest self.test(*self.arg) File "/Users/marca/dev/hg-repos/coverage_msabramo_tox/test/test_farm.py", line 81, in call execfile(self.runpy, glo) File "run_timid.py", line 24, in <module> File "/Users/marca/dev/hg-repos/coverage_msabramo_tox/test/test_farm.py", line 287, in contains assert s in text, "Missing content in %s: %r" % (filename, s) AssertionError: Missing content in out/showtraceout.txt: 'regular CTracer' -------------------- >> begin captured stdout << --------------------- regular PyTracer timid PyTracer

--------------------- >> end captured stdout << ----------------------


Ran 322 tests in 22.924s

FAILED (failures=1) === CPython 2.6.8 with Python tracer (/Users/marca/dev/hg-repos/ve/26/bin/python) === ..................................................................................................................................................................................................................................................................................................................................


Ran 322 tests in 24.653s

OK === CPython 2.7.3 with C tracer (/Users/marca/dev/hg-repos/ve/27/bin/python) === .............................................................................................................................................................................................................................F.................................................................................................... ====================================================================== FAIL: test/farm/run/run_timid.py


Traceback (most recent call last): File "/Users/marca/dev/hg-repos/ve/27/lib/python2.7/site-packages/nose-1.1.2-py2.7.egg/nose/case.py", line 197, in runTest self.test(*self.arg) File "/Users/marca/dev/hg-repos/coverage_msabramo_tox/test/test_farm.py", line 81, in call execfile(self.runpy, glo) File "run_timid.py", line 24, in <module> File "/Users/marca/dev/hg-repos/coverage_msabramo_tox/test/test_farm.py", line 287, in contains assert s in text, "Missing content in %s: %r" % (filename, s) AssertionError: Missing content in out/showtraceout.txt: 'regular CTracer' -------------------- >> begin captured stdout << --------------------- regular PyTracer timid PyTracer

--------------------- >> end captured stdout << ----------------------


Ran 322 tests in 23.726s

FAILED (failures=1) === CPython 2.7.3 with Python tracer (/Users/marca/dev/hg-repos/ve/27/bin/python) === ..................................................................................................................................................................................................................................................................................................................................


Ran 322 tests in 24.410s

OK === CPython 3.3.0b1 with C tracer (/Users/marca/dev/hg-repos/ve/33/bin/python) === ..................................................................................................................................................................................................................................................................................................................................


Ran 322 tests in 28.700s

OK === CPython 3.3.0b1 with Python tracer (/Users/marca/dev/hg-repos/ve/33/bin/python) === ..................................................................................................................................................................................................................................................................................................................................


Ran 322 tests in 28.785s

OK }}}

Comments (10)

  1. Marc Abramowitz reporter

    To reproduce it in a single environment, I can do:

    [last: 0] marca@scml-marca:~/dev/hg-repos/coverage_msabramo_tox$ export COVERAGE_TEST_TRACER=c
    [last: 0] marca@scml-marca:~/dev/hg-repos/coverage_msabramo_tox$ source ../ve/27/bin/activate
    (27)[last: 0] marca@scml-marca:~/dev/hg-repos/coverage_msabramo_tox$ PYTHONPATH=test/eggsrc nosetests
    .............................................................................................................................................................................................................................F....................................................................................................
    ======================================================================
    FAIL: test/farm/run/run_timid.py
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/marca/dev/hg-repos/ve/27/lib/python2.7/site-packages/nose-1.1.2-py2.7.egg/nose/case.py", line 197, in runTest
        self.test(*self.arg)
      File "/Users/marca/dev/hg-repos/coverage_msabramo_tox/test/test_farm.py", line 81, in __call__
        execfile(self.runpy, glo)
      File "run_timid.py", line 24, in <module>
      File "/Users/marca/dev/hg-repos/coverage_msabramo_tox/test/test_farm.py", line 287, in contains
        assert s in text, "Missing content in %s: %r" % (filename, s)
    AssertionError: Missing content in out/showtraceout.txt: 'regular CTracer'
    -------------------- >> begin captured stdout << ---------------------
    regular PyTracer
    timid PyTracer
    
    --------------------- >> end captured stdout << ----------------------
    
    ----------------------------------------------------------------------
    Ran 322 tests in 21.691s
    
    FAILED (failures=1)
    
  2. Marc Abramowitz reporter

    or I can do this:

    ~/dev/hg-repos/coverage_msabramo_tox/test/farm/run/src$ export COVERAGE_TEST_TRACER=c
    ~/dev/hg-repos/coverage_msabramo_tox/test/farm/run/src$ coverage -x -e showtrace.py timid
    timid PyTracer
    
  3. Marc Abramowitz reporter

    Yes, I think that's what it probably is.

    I would suggest that we make coverage exit with a fatal error if you've specifically requested the CTracer (e.g.: via COVERAGE_TEST_TRACER=C and it's not available.

    Something like:

    --- a/coverage/collector.py	Fri Jun 22 01:06:36 2012 -0700
    +++ b/coverage/collector.py	Fri Jul 06 21:16:14 2012 -0700
    @@ -1,12 +1,15 @@
     """Raw data collector for Coverage."""
     
    -import sys, threading
    +import os, sys, threading
     
     try:
         # Use the C extension code when we can, for speed.
         from coverage.tracer import CTracer
     except ImportError:
         # Couldn't import the C extension, maybe it isn't built.
    +    if os.getenv('COVERAGE_TEST_TRACER') == 'c':
    +        sys.stderr.write('COVERAGE_TEST_TRACER was set to "c" and could not find CTracer!\n')
    +        sys.exit(1)
         CTracer = None
    

    which then gives you:

    ~/dev/hg-repos/coverage_msabramo_tox$ COVERAGE_TEST_TRACER=c coverage -x -e test/farm/run/src/showtrace.py regular
    COVERAGE_TEST_TRACER was set to "c" and could not find CTracer!
    

    What do you think?

  4. Marc Abramowitz reporter

    Thanks for adding that!

    I wonder if we should allow setting COVERAGE_TEST_TRACER=py to force the usage of the PyTracer - that would allow me to get rid of the hack I have in my tox.ini of doing rm {toxinidir}/coverage/tracer.so to test the PyTracer.

  5. Marc Abramowitz reporter

    What if we did 3 test runs -- e.g.:

    env COVERAGE_TEST_TRACER="py" nosetests -w {toxinidir}
    env COVERAGE_TEST_TRACER="c" nosetests -w {toxinidir}
    env COVERAGE_TEST_TRACER="" nosetests -w {toxinidir}
    

    ?

  6. Ned Batchelder repo owner

    Sorry, I don't understand what that would accomplish? The only way to test the fallback is to attempt to import the C tracer and fail. The only way to do that is to not have a C tracer. The only way to do that is to remove the C tracer. More test runs won't change that, right?

  7. Marc Abramowitz reporter

    I guess what I proposed would just make it so that you can force the user of the PyTracer even when the .so is present. I don't know if that is useful or not. You're right that in order to test the fallback we do have to remove the C tracer anyway, so I guess removing the line that removes tracer.so is not possible.

    By the way, I updated the tox.ini over in https://bitbucket.org/ned/coveragepy/pull-request/4/add-support-for-tox-http-toxtestrunorg; it looks much better now; maybe even you might want to merge it if you can reproduce the good results that I'm getting.

  8. Log in to comment