#90 HTTPRequest dispatcher tracking exceptions in subclasses

closed
Philip Aston
3
2012-09-29
2006-10-18
Richard Taylor
No

When subclassing HTTPRequest, if an exception happens
in the subclass the error reported is rather misleading.

For example code like this:

from net.grinder.plugin.http import HTTPRequest as
GrinderHTTPRequest

class HTTPRequest(GrinderHTTPRequest):
def processResponse(self,response):
obvious error

Produces the following trace:

File Edit Options Buffers Tools Minibuf Help
10/18/06 1:14:09 PM (thread 0 run 0 test 101): Aborted
run due to Java exception whilst invoking test runner
Java exception whilst invoking test runner
File "simple_IR_submit.py", line 102, in page1
File "simple_IR_submit.py", line 428, in call
Caused by:
net.grinder.engine.process.StopWatch$StopWatchRunningException:
Still running
at
net.grinder.engine.process.StopWatchImplementation.getTime(StopWatchImplementation.java:71)
at
net.grinder.engine.process.StopWatchImplementation.add(StopWatchImplementation.java:78)
at
net.grinder.engine.process.ThreadContextImplementation.popDispatchContext(ThreadContextImplementation.java:197)
at
net.grinder.engine.process.TestData$DispatcherHolder.dispatch(TestData.java:169)
at
net.grinder.engine.process.TestData.dispatch(TestData.java:102)
at
net.grinder.engine.process.jython.JythonScriptEngine$PyDispatcher.dispatch(JythonScriptEngine.java:514)
at
net.grinder.engine.process.jython.InstrumentedPyJavaInstanceForPyMethodsAndPyFunctions.invoke(InstrumentedPyJavaInstanceForPyMethodsAndPyFu\ nctions.java:167)
at
org.python.core.PyInstance.call(PyInstance.java)
at org.python.core.PyObject.call(PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at
org.python.pycode._pyx0.page1$4(simple_IR_submit.py:102)
at
org.python.pycode._pyx0.call_function(simple_IR_submit.py)
at
org.python.core.PyTableCode.call(PyTableCode.java)
at
org.python.core.PyTableCode.call(PyTableCode.java)
at
org.python.core.PyFunction.call(PyFunction.java)
at org.python.core.PyMethod.call(PyMethod.java)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.python.core.PyReflectedFunction.call(PyReflectedFunction.java)
at org.python.core.PyMethod.call(PyMethod.java)
at org.python.core.PyObject.invoke(PyObject.java)
at
net.grinder.engine.process.jython.InstrumentedPyJavaInstanceForPyMethodsAndPyFunctions.access$401(InstrumentedPyJavaInstanceForPyMethodsAnd\ PyFunctions.java:40)
at
net.grinder.engine.process.jython.InstrumentedPyJavaInstanceForPyMethodsAndPyFunctions$5.call(InstrumentedPyJavaInstanceForPyMethodsAndPyFu\ nctions.java:170)
at
net.grinder.engine.process.TestData$Dispatcher.dispatch(TestData.java:229)
at
net.grinder.engine.process.TestData$DispatcherHolder.dispatch(TestData.java:166)
at
net.grinder.engine.process.TestData.dispatch(TestData.java:102)
at
net.grinder.engine.process.jython.JythonScriptEngine$PyDispatcher.dispatch(JythonScriptEngine.java:514)
at
net.grinder.engine.process.jython.InstrumentedPyJavaInstanceForPyMethodsAndPyFunctions.invoke(InstrumentedPyJavaInstanceForPyMethodsAndPyFu\ nctions.java:167)
at
org.python.core.PyInstance.call(PyInstance.java)
at org.python.core.PyObject.call(PyObject.java)
at org.python.core.PyMethod.call(PyMethod.java)
at org.python.core.PyObject.call(PyObject.java)
at
org.python.core.PyInstance.invoke(PyInstance.java)
at
org.python.pycode._pyx0.call$13(simple_IR_submit.py:428)
at
org.python.pycode._pyx0.call_function(simple_IR_submit.py)
at
org.python.core.PyTableCode.call(PyTableCode.java)
at
org.python.core.PyTableCode.call(PyTableCode.java)
at
org.python.core.PyTableCode.call(PyTableCode.java)
at
org.python.core.PyFunction.call(PyFunction.java)
at org.python.core.PyMethod.call(PyMethod.java)
at org.python.core.PyObject.invoke(PyObject.java)
at
org.python.core.PyInstance.call(PyInstance.java)
at org.python.core.PyObject.call(PyObject.java)
at
net.grinder.engine.process.jython.JythonScriptEngine$JythonWorkerRunnable.run(JythonScriptEngine.java:343)
at
net.grinder.engine.process.GrinderThread.run(GrinderThread.java:126)
at java.lang.Thread.run(Thread.java:595)

Discussion

  • Philip Aston
    Philip Aston
    2006-10-18

    Logged In: YES
    user_id=2117

    Fixed in beta32.

    If a plugin or test code threw an exception with the pause
    timer running, the finally block that processes the pause
    timer raised an exception that masked the original one.