initialised newreno in tests
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Jake Hillion 2021-05-13 23:04:00 +01:00
parent 9258bfec77
commit e1241b2cf0

View File

@ -21,8 +21,8 @@ type newRenoTest struct {
halfRtt time.Duration
}
func newNewRenoTest(rtt time.Duration) *newRenoTest {
return &newRenoTest{
func newNewRenoTest(ctx context.Context, rtt time.Duration) *newRenoTest {
nr := &newRenoTest{
sideA: NewNewReno(),
sideB: NewNewReno(),
@ -34,6 +34,12 @@ func newNewRenoTest(rtt time.Duration) *newRenoTest {
halfRtt: rtt / 2,
}
p, _ := nr.sideA.Initial(ctx)
p, _, _ = nr.sideB.Handle(ctx, p)
p, _, _ = nr.sideA.Handle(ctx, p)
return nr
}
func (n *newRenoTest) Start(ctx context.Context) {
@ -151,7 +157,7 @@ func TestNewReno_Congestion(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
c := newNewRenoTest(rtt)
c := newNewRenoTest(ctx, rtt)
c.Start(ctx)
c.RunSideA(ctx)
c.RunSideB(ctx)
@ -189,7 +195,7 @@ func TestNewReno_Congestion(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
c := newNewRenoTest(rtt)
c := newNewRenoTest(ctx, rtt)
c.Start(ctx)
c.RunSideA(ctx)
c.RunSideB(ctx)
@ -233,7 +239,7 @@ func TestNewReno_Congestion(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
c := newNewRenoTest(rtt)
c := newNewRenoTest(ctx, rtt)
c.Start(ctx)
c.RunSideA(ctx)
c.RunSideB(ctx)
@ -293,7 +299,7 @@ func TestNewReno_Congestion(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
c := newNewRenoTest(rtt)
c := newNewRenoTest(ctx, rtt)
c.Start(ctx)
c.RunSideA(ctx)
c.RunSideB(ctx)