Checked in refactored test that hopefully will not break under GUMP
Stefan, please let me know how it works.

Steve Cohen wrote:
 > I thought they just used some unused ports for the test.

That's just it, though. On Gump, these ports do NOT seem to be unused. The test simply assumes that these three ports are unused and fails if they aren't. I think the openConnections() method of this class should look within some range for three unused ports and have the test not run
(instead of fail) if it can't find them. Best would be if there was some way to guarantee that three sockets could be opened somewhere.


Jeffrey D. Brekke wrote:

I'm not sure about those tests and if they need to be looking at specific ports, I thought they just used some unused ports for the test.

We could also move them into the test:functional section so the build is not dependant on them, but then we loose the continual testing benefit.

Steve Cohen wrote:

I should have said "On Gump, this fails, presumably because one of these sockets is sometimes in use."

Steve Cohen wrote:

Has anyone had a chance to look at this?

The root of the problem seems to be that the test assumes that it should always be able to open three sockets at ports 3333, 3334, and 3335, which it tries to do in the initalizing method openConnections(). On Gump, this fails, presumably because one of these sockets is always in use.

Unless there is something special about these three ports, it would seem that this test is flawed. I have seen similar problems when JUnit tests are applied to methods that access databases. Someone might write a test that an "insert" statement works correctly, but forgets about unique constraints or primary keys. Unless the database is in a known state, such tests are not reliable and will fail if the conditions are not right.

Is that what is going on here? It seems to be so. Nothing of the real functionality being tested seems to depend on any specific port. These tests are failing in the initialization, not in the executing of the tests themselves.

It would seem that this initializing method would be better written to try a bunch of port numbers in succession until three have successfully opened and then test these sockets.

Would it be worth doing this, or are there just some places where this test cannot be run, because of permissions, etc. ?





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to