Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 5337 invoked from network); 8 Dec 2006 00:43:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2006 00:43:20 -0000 Received: (qmail 22354 invoked by uid 500); 8 Dec 2006 00:43:26 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 22096 invoked by uid 500); 8 Dec 2006 00:43:25 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 22084 invoked by uid 99); 8 Dec 2006 00:43:25 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 16:43:25 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of alexei.fedotov@gmail.com designates 64.233.184.233 as permitted sender) Received: from [64.233.184.233] (HELO wr-out-0506.google.com) (64.233.184.233) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 16:43:14 -0800 Received: by wr-out-0506.google.com with SMTP id 55so436829wri for ; Thu, 07 Dec 2006 16:42:53 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TT3iHqN2ewcz7o3pgjwU5qTmCyZXExm86LB0bdbCblFV8E6Slbyzt3mBwS62k6PA1qwOHuWGJUOwjWnGVe2EZ7q2dlFDqQpT7u8qhfBgR+zkWxp0twMIFHcJH3KtURWC6efR7NKRjDRCKlHmKQUYWBEdB/XYMbjXmHj78XORQTM= Received: by 10.78.171.13 with SMTP id t13mr232265hue.1165538571841; Thu, 07 Dec 2006 16:42:51 -0800 (PST) Received: by 10.78.133.6 with HTTP; Thu, 7 Dec 2006 16:42:51 -0800 (PST) Message-ID: Date: Fri, 8 Dec 2006 03:42:51 +0300 From: "Alexei Fedotov" To: dev@harmony.apache.org Subject: Re: [classlib][luni] java.net.ServerSocketTest fails - need help In-Reply-To: <3D8E84095C6A524A985B787423094E40872552@mssmsx411> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3D8E84095C6A524A985B787423094E40872552@mssmsx411> X-Virus-Checked: Checked by ClamAV on apache.org Let me share my preferences: * I would choose a dynamic port choice for a huge system which runs tests reliably in perTest mode. Even if one of tests won't free the port, the system will produce a sensible result about other tests. * I would chose a static port number for a acceptance (pre-commit) tests because it is simpler, and we actually don't care how much tests fail: one is enough to stop a commit. On 12/7/06, Zakharov, Vasily M wrote: > Andrew, > > Sure, we can reserve some port, but it means that we would experience > occasional fails of the test from time to time, that's not very good. > > Probably we may check the port using ServerSocket before testing? > It's acceptance, not compliance testing, look like it's not a big > problem. > > Also, for all tests except the test_setReuseAddressZ(), > we way check the port by using Socket, not ServerSocket. > > So, I'd suggest the following measures: > > - For all tests, that could use port 0, use port 0. > By the way, is there a chance that asking port 0 would return a > TIME_WAIT port > that cannot be reused? > > - For all tests except test_setReuseAddressZ() use Socket to verify if > the port is free. > > - For test_setReuseAddressZ() test, use ServerSocket to verify the port > is free > or use the fixed port number from the end of port space (6xxxx). > > Andrew, what do you think? > > Vasily > > > > -----Original Message----- > From: Andrew Zhang [mailto:zhanghuangzhu@gmail.com] > Sent: Wednesday, December 06, 2006 12:59 PM > To: dev@harmony.apache.org > Subject: Re: [classlib][luni] java.net.ServerSocketTest fails - need > help > > On 12/6/06, Alexey Petrenko wrote: > > > > I do not think that reserving one of widely used ports for tests is a > good > > idea. > > Since user can run http server on his machine for example. And I do > > not think that he will be happy to switch it off each time. > > > > I think that we can reserve some port near the end of the port space. > > Somethong like 63527 or so. > > > Exactly! Does Harmony have lucky number? :) > > Another approach is to try another port if ServerSocket reports that > > the port is busy (I do not remember does ServerSocket throw different > > exception for busy port or not...) > > > But it's a test for ServerSocket. We have to know whether this port is > used > before testing ServerSocket. > > For other tests, we've agreed to use port 0 to get a 100% free port. > Sounds > reasonable? > > SY, Alexey > > 2006/12/6, Tony Wu : > > > I think it is reasonable if some essential configuration should be > > > done at first when running harmony tests, especially in java.net. My > > > opinion is to fix some regular used port, like 80, 8080, etc. Users > > > should guarantee that these ports are available when running > testcases > > > (we could document this in our instruction for running test). > > > > > > > > > On 12/6/06, Andrew Zhang wrote: > > > > On 12/6/06, Zakharov, Vasily M > wrote: > > > > > > > > > > > > > > > > oh... Interesting. It's the test for ServerSocket. Some tests > like > > > > > > constructor test have to test not only 0, but also specified > port. > > > > > > Nevertheless, I think it's ok to use port 0 for the case > described > > in > > > > > > Harmony-2338. Comments? > > > > > > > > > > That's exactly the problem - you should test how the > constructors > > > > > (and methods like bind()) handle the specified port numbers, but > for > > > > > that you have to get those numbers fronm somewhere. > > > > > > > > > > > > So shall we reserve a port for running Harmony test and document > it? > > > > > > > > Using port 0 makes the test running, but reduces it's testing > value. > > > > > So it's a give&take solution. > > > > > > > > > > > > Agree. > > > > > > > > Vasily > > > > > > > > > > -----Original Message----- > > > > > From: Andrew Zhang [mailto:zhanghuangzhu@gmail.com] > > > > > Sent: Wednesday, December 06, 2006 7:33 AM > > > > > To: dev@harmony.apache.org > > > > > Subject: Re: [classlib][luni] java.net.ServerSocketTest fails - > need > > > > > help > > > > > > > > > > On 12/6/06, Andrew Zhang wrote: > > > > > > > > > > > > > > > > > > > > > > > > On 12/6/06, Zakharov, Vasily M > > wrote: > > > > > > > > > > > > > > > > > > > > > I've investigated the > > > > > http://issues.apache.org/jira/browse/HARMONY-2338 > > > > > > > issue, > > > > > > > the detailed description of the problem is available at the > JIRA > > > > > page. > > > > > > > > > > > > > > Could anyone qualified in java.net please look into it and > > suggest > > > > > how > > > > > > > this should be fixed? > > > > > > > > > > > > > > There's a problem with tests.api.java.net.ServerSocketTest > test > > > > > design > > > > > > > that uses "random" ports for testing and fails when those > ports > > > > > happen > > > > > > > to be occupied by other applications. > > > > > > > > > > > > > > > > > > Hi Zakharov, I think we've agreed to use port 0 to select a > free > > port > > > > > in > > > > > > test case. > > > > > > > > > > > > But we're doing this lazily. I'll fix ServerSocketTest soon. > > Thanks! > > > > > > > > > > > > > > > > oh... Interesting. It's the test for ServerSocket. Some tests > like > > > > > constructor test have to test not only 0, but also specified > port. > > > > > Nevertheless, I think it's ok to use port 0 for the case > described > > in > > > > > Harmony-2338. Comments? > > > > > > > > > > I see many apparent possible fixes for the problem, but none of > them > > > > > > > looks good enough to implement immediately - they all have > > drawbacks > > > > > and > > > > > > > > > > > > > > I'm not a java.net guru to judge which of those drawbacks > are > > > > > essential > > > > > > > and which are not. > > > > > > > > > > > > > > Thank you! > > > > > > > > > > > > > > Vasily Zakharov > > > > > > > Intel Enterprise Solutions Software Division > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Best regards, > > > > > > Andrew Zhang > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Best regards, > > > > > Andrew Zhang > > > > > > > > > > > > > > > > > > > > > -- > > > > Best regards, > > > > Andrew Zhang > > > > > > > > > > > > > > > > > -- > > > Tony Wu > > > China Software Development Lab, IBM > > > > > > > > > -- > Best regards, > Andrew Zhang > -- With best regards, Alexei, Intel