mirror of
https://github.com/golang/go.git
synced 2025-05-16 12:54:37 +00:00
net/http: relax the matching of strace output in test
Modify the regex in TestLinuxSendfile to not match the parameters of the syscall, just its name and the opening parenthesis. This is enough to recognize that the syscall was invoked. This fixes the TestLinuxSendfile test when running in Clear Linux, where strace always execute with -yy implied, having output with extra information in the parameters: [pid 5336] sendfile(6<TCP:[127.0.0.1:35007->127.0.0.1:55170]>, 8</home/c/src/go/src/net/http/testdata/index.html>, NULL, 22) = 22 Change-Id: If7639b785d5fdf65fae8e6149a97a57b06ea981c Reviewed-on: https://go-review.googlesource.com/85657 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
5305bdd86b
commit
2ba3fd484b
@ -1140,7 +1140,7 @@ func TestLinuxSendfile(t *testing.T) {
|
|||||||
Post(fmt.Sprintf("http://%s/quit", ln.Addr()), "", nil)
|
Post(fmt.Sprintf("http://%s/quit", ln.Addr()), "", nil)
|
||||||
child.Wait()
|
child.Wait()
|
||||||
|
|
||||||
rx := regexp.MustCompile(`sendfile(64)?\(\d+,\s*\d+,\s*NULL,\s*\d+`)
|
rx := regexp.MustCompile(`sendfile(64)?\(`)
|
||||||
out := buf.String()
|
out := buf.String()
|
||||||
if !rx.MatchString(out) {
|
if !rx.MatchString(out) {
|
||||||
t.Errorf("no sendfile system call found in:\n%s", out)
|
t.Errorf("no sendfile system call found in:\n%s", out)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user