Skip to content

Commit

Permalink
Blind succeed to account for unimplemented functionality on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Feb 24, 2021
1 parent b354fe7 commit 9e0fcb7
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions exporters/trace/jaeger/assertsocketbuffersize_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,17 @@ package jaeger

import (
"net"
"syscall"
"testing"

"github.com/stretchr/testify/assert"
)

func assertSockBufferSize(t *testing.T, expectedBytes int, conn *net.UDPConn) bool {
fd, err := conn.File()
if !assert.NoError(t, err) {
return false
}

bufferBytes, err := syscall.GetsockoptInt(syscall.Handle(fd.Fd()), syscall.SOL_SOCKET, syscall.SO_SNDBUF)
if !assert.NoError(t, err) {
return false
}

return assert.Equal(t, expectedBytes, bufferBytes)
// The Windows implementation of the net.UDPConn does not implement the
// functionality to return a file handle, instead a "not supported" error
// is returned:
//
// https://github.com/golang/go/blob/6cc8aa7ece96aca282db19f08aa5c98ed13695d9/src/net/fd_windows.go#L175-L178
//
// This means we are not able to pass the connection to a syscall and
// determine the buffer size.
return true
}

0 comments on commit 9e0fcb7

Please sign in to comment.