From: Caio Marcelo de Oliveira Filho Date: Tue, 2 Jan 2018 01:17:14 +0000 (-0800) Subject: net/http: relax the matching of strace output in test X-Git-Tag: go1.10beta2~73 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2ba3fd484bb048be86c2bd804900151a1ec5affd;p=gostls13.git 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(6127.0.0.1:55170]>, 8, NULL, 22) = 22 Change-Id: If7639b785d5fdf65fae8e6149a97a57b06ea981c Reviewed-on: https://go-review.googlesource.com/85657 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/net/http/fs_test.go b/src/net/http/fs_test.go index e766dc69f4..6ab122cf82 100644 --- a/src/net/http/fs_test.go +++ b/src/net/http/fs_test.go @@ -1140,7 +1140,7 @@ func TestLinuxSendfile(t *testing.T) { Post(fmt.Sprintf("http://%s/quit", ln.Addr()), "", nil) child.Wait() - rx := regexp.MustCompile(`sendfile(64)?\(\d+,\s*\d+,\s*NULL,\s*\d+`) + rx := regexp.MustCompile(`sendfile(64)?\(`) out := buf.String() if !rx.MatchString(out) { t.Errorf("no sendfile system call found in:\n%s", out)