mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Fondermann <bf_...@brainlounge.de>
Subject Re: svn commit: r794145 - in /mina/sandbox/vysper/trunk/src/test/java/org/apache/vysper/xmpp/modules/extension/xep0199_xmppping: AbstractIntegrationTestCase.java PingPacket.java XmppPingIntegrationTestCase.java XmppPingNoSupportIntegrationTestCase.ja
Date Mon, 03 Aug 2009 08:05:23 GMT
Niklas Gustavsson wrote:
> On Wed, Jul 15, 2009 at 8:03 AM, <ngn@apache.org> wrote:
>> Author: ngn
>> Date: Wed Jul 15 06:03:11 2009
>> New Revision: 794145
>> URL: http://svn.apache.org/viewvc?rev=794145&view=rev
>> Log:
>> Adding integration tests for XEP-0199 XMPP Ping (VYSPER-12). AbstractIntegrationTest
should go somewhere else once we decide that we want to do tests like this.
> Alright, this is a first stab at what integration tests (running the
> complete server and testing it with an external client) could look
> like. Have a look and let me know what you think.

This test perfectly demonstrates the pros and cons of integration
testing of socket based protocols.

All test run within about 5.3 seconds on my machine, probably less on yours.

The integration test _alone_ takes 5 seconds! (Which makes me want to
disable it. Suggestion: Can we move integration tests to a separate
source folder so they can easily be excluded  from running?)

Why is that? The tests sets up the whole server infrastructure. This
adds overhead to the test, but is not the cause for the long running
time. It's Thread.sleep(5000). This is a common problem with testing
async stuff. Maybe we can reduce this to 100 ms, but this might cause
spurious test failures for some, which are hard to reproduce.

A better approach - if possible - would be to have a listener kicking in
when the async processing is finished, causing some kind of continuation
to finish of the test.

In general I'd stick with my original statement to discourage using this
kinds of tests for handlers.


View raw message