Patchwork libgo patch committed: Fixes for select based pollster

login
register
mail settings
Submitter Rainer Orth
Date Feb. 7, 2013, 4:51 p.m.
Message ID <yddd2wcysmm.fsf@lokon.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/218955/
State New
Headers show

Comments

Rainer Orth - Feb. 7, 2013, 4:51 p.m.
Ian Lance Taylor <iant@google.com> writes:

> On Solaris the libgo networking library uses select.  This patch
> implements some fixes for that code.  The Close method is changed to
> actually do something; this is mainly for testing purposes.  More
> importantly, when a socket is closed, the select needs to be restarted
> so that the callers see the close.  Bootstrapped and ran Go testsuite on
> x86_64-unknown-linux-gnu.  Committed to mainline.
>

Thanks, this got net to almost passing on Solaris: the only remaining
failure is

pollServer WaitFD: pollster closed
--- FAIL: TestMulticastListener (0.00 seconds)
multicast_posix_test.go:70:     "224.0.0.254:12345" not found in RIB
multicast_posix_test.go:75:     "224.0.0.254:12345" not found in RIB
multicast_posix_test.go:70:     "224.0.0.254:12345" not found in RIB
multicast_posix_test.go:75:     "224.0.0.254:12345" not found in RIB
Select unexpected fd=13 for write
FAIL
FAIL: net

which is no wonder since Solaris still uses interface_stub.go.  I've
checked what it takes to implement those interfaces, but it's quite an
effort, so for the moment we should just skip the test.

The following patch does this and allows the net test to pass.

	Rainer


2013-02-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR go/56172
	* go/net/multicast_posix_test.go (TestMulticastListener): Skip on
	solaris.
Ian Taylor - Feb. 7, 2013, 5:04 p.m.
On Thu, Feb 7, 2013 at 8:51 AM, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
> Ian Lance Taylor <iant@google.com> writes:
>
>> On Solaris the libgo networking library uses select.  This patch
>> implements some fixes for that code.  The Close method is changed to
>> actually do something; this is mainly for testing purposes.  More
>> importantly, when a socket is closed, the select needs to be restarted
>> so that the callers see the close.  Bootstrapped and ran Go testsuite on
>> x86_64-unknown-linux-gnu.  Committed to mainline.
>>
>
> Thanks, this got net to almost passing on Solaris: the only remaining
> failure is
>
> pollServer WaitFD: pollster closed
> --- FAIL: TestMulticastListener (0.00 seconds)
> multicast_posix_test.go:70:     "224.0.0.254:12345" not found in RIB
> multicast_posix_test.go:75:     "224.0.0.254:12345" not found in RIB
> multicast_posix_test.go:70:     "224.0.0.254:12345" not found in RIB
> multicast_posix_test.go:75:     "224.0.0.254:12345" not found in RIB
> Select unexpected fd=13 for write
> FAIL
> FAIL: net
>
> which is no wonder since Solaris still uses interface_stub.go.  I've
> checked what it takes to implement those interfaces, but it's quite an
> effort, so for the moment we should just skip the test.
>
> The following patch does this and allows the net test to pass.

Thanks.  Committed.

Ian

Patch

diff --git a/libgo/go/net/multicast_posix_test.go b/libgo/go/net/multicast_posix_test.go
--- a/libgo/go/net/multicast_posix_test.go
+++ b/libgo/go/net/multicast_posix_test.go
@@ -47,7 +47,7 @@  var multicastListenerTests = []struct {
 // listener with same address family, same group address and same port.
 func TestMulticastListener(t *testing.T) {
 	switch runtime.GOOS {
-	case "netbsd", "openbsd", "plan9", "windows":
+	case "netbsd", "openbsd", "plan9", "solaris", "windows":
 		t.Skipf("skipping test on %q", runtime.GOOS)
 	case "linux":
 		if runtime.GOARCH == "arm" || runtime.GOARCH == "alpha" {