From df7c82a60c67e9188de752584b981708dd7b94d1 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 24 May 2021 13:02:40 -0700 Subject: Move RunImmediatelyScheduledJobs to faketime Use it everywhere. PiperOrigin-RevId: 375539262 --- pkg/tcpip/network/internal/testutil/BUILD | 1 - pkg/tcpip/network/internal/testutil/testutil.go | 14 -------------- 2 files changed, 15 deletions(-) (limited to 'pkg/tcpip/network/internal/testutil') diff --git a/pkg/tcpip/network/internal/testutil/BUILD b/pkg/tcpip/network/internal/testutil/BUILD index b36134ddd..a180e5c75 100644 --- a/pkg/tcpip/network/internal/testutil/BUILD +++ b/pkg/tcpip/network/internal/testutil/BUILD @@ -15,7 +15,6 @@ go_library( deps = [ "//pkg/tcpip", "//pkg/tcpip/buffer", - "//pkg/tcpip/faketime", "//pkg/tcpip/header", "//pkg/tcpip/stack", ], diff --git a/pkg/tcpip/network/internal/testutil/testutil.go b/pkg/tcpip/network/internal/testutil/testutil.go index 328d5efee..605e9ef8d 100644 --- a/pkg/tcpip/network/internal/testutil/testutil.go +++ b/pkg/tcpip/network/internal/testutil/testutil.go @@ -19,27 +19,13 @@ package testutil import ( "fmt" "math/rand" - "time" "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/buffer" - "gvisor.dev/gvisor/pkg/tcpip/faketime" "gvisor.dev/gvisor/pkg/tcpip/header" "gvisor.dev/gvisor/pkg/tcpip/stack" ) -const ( - // immediateDuration is a duration of zero for scheduling work that needs to - // be done immediately but asynchronously to avoid deadlock. - immediateDuration time.Duration = 0 -) - -// RunImmediatelyScheduledJobs runs all jobs scheduled to run at the current -// time. -func RunImmediatelyScheduledJobs(clock *faketime.ManualClock) { - clock.Advance(immediateDuration) -} - // MockLinkEndpoint is an endpoint used for testing, it stores packets written // to it and can mock errors. type MockLinkEndpoint struct { -- cgit v1.2.3