Re: [Zope3-dev] Bug in functional doctest suite?

2007-05-03 Thread Maciej Wisniowski

> I saw you submit two issues that sounded the same. Are they?
>
>   
These are different things but all are somewhat connected
with Retry exception.
In fact I've submitted three issues. Not sure which
you consider same?

I was working on cxoracleda to add handling for
some oracle errors and I found it is impossible
because of two Zope bugs. I've written a test for one
of these bugs, but I found this is not possible to run
this test because of a bug in functional test suite. So
in summary I have 3 bug reports:

1. Bug in zope.rdb that causes all errors from rdbms adapter
to be catched what is wrong as Retry and ConflictError exceptions
should be propagated.
https://bugs.launchpad.net/zope3/+bug/85

2. Bug with handling Retry exception when using views.
In short publisher doesn't retry requests after a Retry exception but
raises NotFound exception instead - this is only when using views.
This issue might be a critical one as Retry and ConflictError
exceptions are very important part of zope transaction machinery.

I don't know where exactly this bug is located but there is a workaround
mentioned in my bug report and also I've written a test
that shows wrong behaviour. Unfortunatelly this test first fails
because of a bug in functional test case (described below) and only after
fixing functional test case it shows real problem with Retry and views.
So in fact my test reveals two bugs at once.

https://bugs.launchpad.net/zope3/+bug/111845

3. Bug in functional test case
Functional test case doesn't handle Retry exceptions properly:
https://bugs.launchpad.net/zope3/+bug/111848

-- 
Maciej Wisniowski
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Bug in functional doctest suite?

2007-05-02 Thread Christian Theune
Am Mittwoch, den 02.05.2007, 20:52 +0200 schrieb Maciej Wisniowski:
> I've submitted this issue to the collector:
> https://bugs.launchpad.net/zope3/+bug/111848

I saw you submit two issues that sounded the same. Are they?

Christian

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Bug in functional doctest suite?

2007-05-02 Thread Maciej Wisniowski
I've submitted this issue to the collector:
https://bugs.launchpad.net/zope3/+bug/111848


-- 
Maciej Wisniowski
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Bug in functional doctest suite?

2007-05-01 Thread Maciej Wisniowski
Hi

I was trying to write test to expose bug with
Retry exception and views and I used functional
doctests for this.

I found that in zope/app/testing/functional.py
there is a class HTTPCaller with __call__ method like:

class HTTPCaller(CookieHandler):
"""Execute an HTTP request string via the publisher"""

def __call__(self, request_string, handle_errors=True, form=None):
(...)
response = ResponseWrapper(
request.response, path,
omit=('x-content-type-warning', 'x-powered-by'),
)

publish(request, handle_errors=handle_errors)
self.saveCookies(response)
setSite(old_site)

# sync Python connection:
getRootFolder()._p_jar.sync()

return response

I was dealing with Retry exception and I get
strange errors during test. I found it is because
__call__ method assumes that request and response
are same objects during whole function.
It is not true when Retry exception is raised by
published code because retry creates new request
and response objects.
I think above code should be changed to:

class HTTPCaller(CookieHandler):
"""Execute an HTTP request string via the publisher"""

def __call__(self, request_string, handle_errors=True, form=None):
(...)
request = publish(request, handle_errors=handle_errors)

response = ResponseWrapper(
request.response, path,
omit=('x-content-type-warning', 'x-powered-by'),
)

self.saveCookies(response)
setSite(old_site)

# sync Python connection:
getRootFolder()._p_jar.sync()

return response

Any opinions? I can say that only with this change my tests for Retry
exception are working as they should.

I think tomorrow I'll be able to submit this and another bug reports
to the collector (another bug is one with Retry and views) because
at last I think I've written test that exposes both of these bugs.
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com