Skip to content

Commit

Permalink
Remove requestDelay flag for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-su committed Apr 19, 2024
1 parent 24ed062 commit 55a83da
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
7 changes: 0 additions & 7 deletions test/conformance/ingress/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ func TestTimeout(t *testing.T) {

func checkTimeout(ctx context.Context, t *testing.T, client *http.Client, name string, code int, initial time.Duration, timeout time.Duration) {
t.Helper()
if test.NetworkingFlags.RequestDelay < 0 {
t.Error("Error creating Request:", fmt.Errorf("request delay value must be greater than or equal to 0, receieved %d", test.NetworkingFlags.RequestDelay))
}
if test.NetworkingFlags.RequestDelay > 0 {
t.Logf("delay of %d before doing the request", test.NetworkingFlags.RequestDelay)
time.Sleep(time.Duration(test.NetworkingFlags.RequestDelay) * time.Second)
}

resp, err := client.Get(fmt.Sprintf("http://%s.%s?initialTimeout=%d&timeout=%d",
name, test.NetworkingFlags.ServiceDomain, initial.Milliseconds(), timeout.Milliseconds()))
Expand Down
9 changes: 0 additions & 9 deletions test/conformance/ingress/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1135,15 +1135,6 @@ func RuntimeRequestWithExpectations(ctx context.Context, t *testing.T, client *h
opts ...RequestOption) *types.RuntimeInfo {
t.Helper()

if test.NetworkingFlags.RequestDelay < 0 {
t.Error("Error creating Request:", fmt.Errorf("request delay value must be greater than or equal to 0, receieved %d", test.NetworkingFlags.RequestDelay))
return nil
}
if test.NetworkingFlags.RequestDelay > 0 {
t.Logf("delay of %d before doing the request", test.NetworkingFlags.RequestDelay)
time.Sleep(time.Duration(test.NetworkingFlags.RequestDelay) * time.Second)
}

req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
t.Error("Error creating Request:", err)
Expand Down
6 changes: 0 additions & 6 deletions test/e2e_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type NetworkingEnvironmentFlags struct {
SkipTests string // Indicates the test names we want to skip in alpha or beta features.
ClusterSuffix string // Specifies the cluster DNS suffix to be used in tests.
ServiceDomain string // Specifies the domain to use when creating the test services.
RequestDelay int // Specifies delay in Seconds before the client tries to dial the service
}

func initializeNetworkingFlags() *NetworkingEnvironmentFlags {
Expand Down Expand Up @@ -107,10 +106,5 @@ func initializeNetworkingFlags() *NetworkingEnvironmentFlags {
"example.com",
"Set this flag to the domain to be used in tests.")

flag.IntVar(&f.RequestDelay,
"request-delay",
0,
"Set this flag to the number of seconds to wait before calling the service.")

return &f
}

0 comments on commit 55a83da

Please sign in to comment.