Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test fails after running them twice in a row #53

Open
GoogleCodeExporter opened this issue Dec 2, 2015 · 1 comment
Open

test fails after running them twice in a row #53

GoogleCodeExporter opened this issue Dec 2, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

I don't know if this should be considered an issue. I have edited unittest.py 
in order to run the tests more than once in the same Python instance.

What steps will reproduce the problem?
1. Open %your_path_to_python_lib%/unittest.py in your editor
2. Comment all the "sys.exit(...)" you find (there are 2 in mine)
3. Open a Python shell and run:
import PyV8
import unittest
unittest.main(PyV8)
unittest.main(PyV8)


What is the expected output? What do you see instead?
The first "unittest.main(PyV8)" returns:
----------------------------------------------------------------------
Ran 38 tests in 2.902s

OK

The second time, I get:
EF...E......F.........................
======================================================================
ERROR: testMultiNamespace (pyv8.PyV8.TestContext)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pyv8\PyV8.py", line 548, in testMultiNamespace
    self.assert_(not bool(JSContext.entered))
JSError: JSError: <HandleScope::HandleScope> Entering the V8 API without proper 
locking in place

======================================================================
ERROR: testExtension (pyv8.PyV8.TestEngine)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pyv8\PyV8.py", line 1371, in testExtension
    self.assertRaises(JSError, ctxt.eval, "hello('flier')")
  File "pyv8\PyV8.py", line 467, in __exit__
    self.leave()
JSError: JSError: <v8::Context::Exit()> Cannot exit non-entered context

======================================================================
FAIL: testEventDispatch (pyv8.PyV8.TestDebug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pyv8\PyV8.py", line 1531, in testEventDispatch
    self.assertEquals(4, len(self.events))
AssertionError: 4 != 8

======================================================================
FAIL: testLocker (pyv8.PyV8.TestMutithread)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "pyv8\PyV8.py", line 1182, in testLocker
    self.assertFalse(JSLocker.actived)
AssertionError

----------------------------------------------------------------------
Ran 38 tests in 2.792s

FAILED (failures=2, errors=2)




What version of the product are you using? On what operating system?
OS: Windows Vista
Python 2.6.4
Boost 1_42_0
V8 2.2.19
PyV8 Trunk (rev 269)


Please provide any additional information below.

Again, I don't know if this should be taken seriously, maybe a testcase is not 
meant to be run twice and is leaving a JSContext "entered". Thanks.

Original issue reported on code.google.com by [email protected] on 23 Jun 2010 at 11:06

@GoogleCodeExporter
Copy link
Author

I will check the #1 and #2 issue, it seems there are some contexts was leaked.

The #3 is OK, because TestDebug.events is a class field, I could change it to a 
object field.
The #4 is OK, because the lock only could be enable once, and can't be disabled 
again.

Thanks

Original comment by [email protected] on 24 Jun 2010 at 1:37

  • Changed state: Accepted
  • Added labels: OpSys-All

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant