1. 15 Dec, 2016 1 commit
  2. 13 Dec, 2016 1 commit
    • Brad Fitzpatrick's avatar
      context: deflake tests under Go 1.6 · cfae461c
      Brad Fitzpatrick authored
      The context tests were flaky under Go 1.6 on Windows. Make them
      slower, but make up for the slowness by parallelizing them.
      
      These tests don't run on Go 1.7+ in the subrepo. They were deflaked in
      the standard library's context in Go 1.7.
      
      Updates golang/go#11811
      
      Change-Id: I8dc8d9e13e72e87b4444e92d2316dd95bd7d066d
      Reviewed-on: https://go-review.googlesource.com/34288
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      cfae461c
  3. 10 Dec, 2016 2 commits
    • Brad Fitzpatrick's avatar
      http2: speed up TestTransportFlowControl in short mode · b1a2d6e8
      Brad Fitzpatrick authored
      Updates golang/go#18273
      
      Change-Id: I2e7589d070a2953972bc8456d572edd616525266
      Reviewed-on: https://go-review.googlesource.com/34271
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarTom Bergan <tombergan@google.com>
      b1a2d6e8
    • Tom Bergan's avatar
      http2: don't flush a stream's write queue in sc.resetStream · 3d9a20a7
      Tom Bergan authored
      resetStream(st) queues a RST_STREAM frame and then calls closeStream(st).
      Unfortunately, closeStream(st) flushes any writes pending on st, which
      can drop the RST_STREAM that was just queued. (If we are lucky, the
      RST_STREAM will fit in the send buffer and won't be dropped, however,
      if we are unlucky the RST_STREAM will be dropped.)
      
      I fixed this bug by removing closeStream(st) from resetStream. Instead,
      closeStream happens after the RST_STREAM frame is written. This is a more
      direct implementation of the diagram in RFC 7540 Section 5.1, which says
      that a stream does not transition to "closed" until after the RST_STREAM
      has been sent.
      
      A side-effect is that the stream may stay open for longer than it did
      previously (since it won't close until *after* the RST_STREAM frame is
      actually written). Situations like the following are a problem:
      
      - Client sends a DATA frame that exceeds its flow-control window
      - Server returns streamError(ErrCodeFlowControl) from processData
      - RST_STREAM is queued behind other frames
      - Server process the request body and releases flow-control
      - Client sends another DATA frame, this one fits in the flow-control
        window. Server should NOT process this frame.
      
      To avoid the above problem, we set a bool st.resetQueued=true when
      RST_STREAM is queued, then ignore all future incoming HEADERS and DATA
      frames on that stream.
      
      I also removed st.sentReset and st.gotReset, which were used to ignore
      frames after RST_STREAM is sent. Now we just check if the stream is closed.
      
      Fixes golang/go#18111
      
      Change-Id: Ieb7c848989431add5b7d95f40d6d91db7edc4980
      Reviewed-on: https://go-review.googlesource.com/34238Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3d9a20a7
  4. 08 Dec, 2016 2 commits
    • Brad Fitzpatrick's avatar
      http2: allow Transport to connect to https://[v6literal]/ without port · e31bd588
      Brad Fitzpatrick authored
      Fixes golang/go#18248
      
      Change-Id: I271fbcc68a86f20c57b258c2e25788908dafdd94
      Reviewed-on: https://go-review.googlesource.com/34143Reviewed-by: 's avatarTom Bergan <tombergan@google.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e31bd588
    • Tom Bergan's avatar
      http2: log Framer reads and writes when a server test fails · cbed01e8
      Tom Bergan authored
      To help debug rare nondeterministic server_test failures, log Framer
      reads and writes. Sample output from an injected test failure:
      
      $ go test golang.org/x/net/http2
      --- FAIL: TestServer_Request_Reject_Pseudo_scheme_invalid (0.00s)
          server_test.go:998: server request made it to handler; should've been rejected
          server_test.go:514: got a *http2.HeadersFrame; want *RSTStreamFrame
          server_test.go:229: Framer read log:
              2016-12-07 17:06:11.907199013 Framer 0xc4212665b0: read SETTINGS len=18, settings: MAX_FRAME_SIZE=1048576, MAX_CONCURRENT_STREAMS=250, MAX_HEADER_LIST_SIZE=1048896
              2016-12-07 17:06:11.907523124 Framer 0xc4212665b0: read SETTINGS flags=ACK len=0
              2016-12-07 17:06:11.908090453 Framer 0xc4212665b0: read HEADERS flags=END_STREAM|END_HEADERS stream=1 len=48
          server_test.go:235: Framer write log:
              2016-12-07 17:06:11.907152927 Framer 0xc4212665b0: wrote SETTINGS len=0
              2016-12-07 17:06:11.907207016 Framer 0xc4212665b0: wrote SETTINGS flags=ACK len=0
              2016-12-07 17:06:11.907550525 Framer 0xc4212665b0: wrote HEADERS flags=END_STREAM|END_HEADERS stream=1 len=16
      
      Framer logs are written at the end of a test only if the test failed
      and only if http2debug!=2. (If http2debug=2, then Framer logs are already
      written to stdout.)
      
      Hopefully this will help debug flaky tests. Or it might not.
      The code is kind of ugly.
      
      Updates golang/go#18235
      
      Change-Id: I74c8ef82521d81f123663c98c883c71d9843964f
      Reviewed-on: https://go-review.googlesource.com/34130
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      cbed01e8
  5. 07 Dec, 2016 3 commits
    • Brad Fitzpatrick's avatar
      ipv4: deflake TestConnUnicastSocketOptions on Windows · 944c58e9
      Brad Fitzpatrick authored
      TestConnUnicastSocketOptions doesn't work on nacl, plan9, or windows,
      but the t.Skip at the top was missing the GOOS == "windows" check. (It
      was present in the ipv6 version of the test)
      
      The test than proceeded to try to run and set up a connection pair
      for testing. Here's what was happening.
      
      Goroutines are M (main, the client) and S (server, doing the Accept):
      
         M: net.Listen("tcp4", "127.0.0.1:0"), succeeds.
         M: defer ln.Close() enqueued.
         M: go acceptor() (start "S" (server) goroutine)
         M: net.Dial("tcp4", ln.Addr().String()), succeeds.
            Notably, it's connected to the kernel's TCP stack at this point.
            The userspace Accept hasn't run. Go's listen backlog is
            syscall.SOMAXCONN on Windows (which is fine).
         M: testUnicastSocketOptions:
            - finds that it's GOOS == "windows",
            - calls t.Skipf, which calls runtime.Goexit, runs deferred goroutines
         M: ln.Close() (previously deferred runs)
         M: test completes
      
      Then:
      
         S: server goroutine finally schedules
         S: c, err := ln.Accept(), gets an error (because it's closed)
            if err != nil {
                 t.Error(err)   // setting an error after test is done; bogus
      
      So, fix it both ways: skip the test earlier on "windows", and simplify
      the server goroutine and move the failing into the main goroutine.
      Also skip other tests earlier on Windows that will also t.Skip. They
      don't have goroutines, but might as well skip earlier.
      
      Fixes golang/go#17655
      
      Change-Id: I5d910d70943be37b2b4b56542ee98e42fc3acd71
      Reviewed-on: https://go-review.googlesource.com/34021
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarBryan Mills <bcmills@google.com>
      944c58e9
    • Mikio Hara's avatar
      ipv4: add missing IP_HDRINCL option on Windows · de22433a
      Mikio Hara authored
      Change-Id: Ibb7dacadef404f6fc4e6c744a5015835e580c97e
      Reviewed-on: https://go-review.googlesource.com/34094
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      de22433a
    • Mikio Hara's avatar
      nettest: update comment on MakePipe · 97730608
      Mikio Hara authored
      To warn about the provided stop function should not be nil.
      
      Change-Id: I73351b6379ae22e85298ce9e87ee80077f748c7e
      Reviewed-on: https://go-review.googlesource.com/34091
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      Reviewed-by: 's avatarJoe Tsai <thebrokentoaster@gmail.com>
      97730608
  6. 06 Dec, 2016 5 commits
  7. 02 Dec, 2016 2 commits
  8. 16 Nov, 2016 5 commits
  9. 15 Nov, 2016 4 commits
  10. 14 Nov, 2016 4 commits
  11. 10 Nov, 2016 1 commit
  12. 09 Nov, 2016 1 commit
  13. 08 Nov, 2016 3 commits
  14. 07 Nov, 2016 1 commit
  15. 04 Nov, 2016 2 commits
  16. 03 Nov, 2016 1 commit
    • Brad Fitzpatrick's avatar
      http2: fix over-aggressive ignoring of frames while in "go away" mode · 569280fa
      Brad Fitzpatrick authored
      https://golang.org/cl/31727 made many of the Server Frame processors
      ignore incoming frames if the connection was in shutdown mode.
      
      The idea was that it's pointless to do work if we're about to hang up
      on them in 250ms anyway for violating a protocol error.
      
      But as of https://golang.org/cl/32412 (graceful shutdown) we can also
      be in "go away" mode for ErrCodeNo, which just means to nicely tell
      them to GOAWAY and because they did nothing wrong, we don't hang up in
      250ms (the value of which gave the peer time to read the error before
      the TCP close), but instead we keep the conn open until it's idle.
      
      The combination of the two CLs made TestTransportAndServerSharedBodyRace_h2
      flaky, since it was never seeing RST_STREAM on cancelation of requests,
      and then Handlers would block forever.
      
      Updates golang/go#17733 (fixes after bundle into std)
      
      Change-Id: I67491c1d7124bc3cb554f9246ea7683f20b6a4e3
      Reviewed-on: https://go-review.googlesource.com/32583
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      569280fa
  17. 02 Nov, 2016 2 commits