guyskk / guyskk/pyv8

test fails after running them twice in a row

Open
#53 1 comment 0 reactions 0 assignees View on GitHub
auto-migrated OpSys-All Priority-Medium Type-Defect
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
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: 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: 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 `mmuradas...@gtempaccount.com` on 23 Jun 2010 at 11:06

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with unittest.py and the two sys.exit(...) calls, then inspect the repeated unittest.main(PyV8) entry point. Reproduce the run in a Python 2.6.4 environment using the PyV8 test methods named in the report, including testMultiNamespace, testExtension, testEventDispatch, and testLocker. Done means the full suite can run twice in one Python instance without the second run producing errors or failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.