forked from quic-go/quic-go
migrate the transport tests away from Ginkgo (#4783)
* migrate the transport tests away from Ginkgo * simplify mock net.PacketConn implementation
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/quic-go/quic-go/internal/mocks"
|
||||
@@ -18,18 +17,6 @@ import (
|
||||
"go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// in the tests for the stream deadlines we set a deadline
|
||||
// and wait to make an assertion when Read / Write was unblocked
|
||||
// on the CIs, the timing is a lot less precise, so scale every duration by this factor
|
||||
func scaleDuration(t time.Duration) time.Duration {
|
||||
scaleFactor := 1
|
||||
if f, err := strconv.Atoi(os.Getenv("TIMESCALE_FACTOR")); err == nil { // parsing "" errors, so this works fine if the env is not set
|
||||
scaleFactor = f
|
||||
}
|
||||
Expect(scaleFactor).ToNot(BeZero())
|
||||
return time.Duration(scaleFactor) * t
|
||||
}
|
||||
|
||||
var _ = Describe("Stream", func() {
|
||||
const streamID protocol.StreamID = 1337
|
||||
|
||||
|
||||
Reference in New Issue
Block a user