Skip to content

Commit 943e0c7

Browse files
committed
test logging
1 parent 0891e9b commit 943e0c7

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

test/e2e/framework/kubernetes/port-forward.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ func (p *PortForward) Run() error {
6464
targetPodName := ""
6565
if p.OptionalLabelAffinity != "" {
6666
// get all pods with label
67+
log.Printf("attempting to find pod with label \"%s\", on a node with a pod with label \"%s\"\n", p.LabelSelector, p.OptionalLabelAffinity)
6768
targetPodName, err = p.findPodsWithAffinity(pctx, clientset)
6869
if err != nil {
6970
return fmt.Errorf("could not find pod with affinity: %w", err)
7071
}
7172
}
7273

7374
portForwardFn := func() error {
74-
log.Printf("attempting port forward to a pod with label \"%s\", in namespace \"%s\"...\n", p.LabelSelector, p.Namespace)
7575

7676
// if we have a pod name (likely from affinity above), use it, otherwise use label selector
7777
opts := k8s.PortForwardingOpts{
@@ -85,6 +85,8 @@ func (p *PortForward) Run() error {
8585
opts.PodName = targetPodName
8686
}
8787

88+
log.Printf("attempting port forward to pod name \"%s\" with label \"%s\", in namespace \"%s\"...\n", targetPodName, p.LabelSelector, p.Namespace)
89+
8890
p.pf, err = k8s.NewPortForwarder(config, &logger{}, opts)
8991
if err != nil {
9092
return fmt.Errorf("could not create port forwarder: %w", err)

test/e2e/framework/types/step_sleep.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Sleep struct {
1010
}
1111

1212
func (c *Sleep) Run() error {
13-
log.Printf("sleeping for %s...\n", c.Duration)
13+
log.Printf("sleeping for %s...\n", c.Duration.String())
1414
time.Sleep(c.Duration)
1515
return nil
1616
}

test/e2e/scenarios/hubble/drop/scenario.go

-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package drop
22

33
import (
4-
"time"
5-
64
k8s "github.com/Azure/azure-container-networking/test/e2e/framework/kubernetes"
75
"github.com/Azure/azure-container-networking/test/e2e/framework/types"
86
)
@@ -15,10 +13,6 @@ const (
1513
// L4 protocols
1614
TCP = "TCP"
1715
UDP = "UDP"
18-
19-
sleepDelay = 5
20-
defaultTimeout = 300 * time.Second
21-
defaultRetryDelay = 5 * time.Second
2216
)
2317

2418
func ValidateDropMetric() *types.Scenario {

test/e2e/scenarios/hubble/drop/validate-drop-metric.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"log"
88
"net/http"
99
"reflect"
10+
"time"
1011

1112
"github.com/Azure/azure-container-networking/test/internal/retry"
1213
promclient "github.com/prometheus/client_model/go"
@@ -21,7 +22,10 @@ const (
2122
protcolKey = "protocol"
2223
reason = "reason"
2324

24-
defaultRetryAttempts = 20
25+
sleepDelay = 5 * time.Second
26+
defaultTimeout = 300 * time.Second
27+
defaultRetryDelay = 5 * time.Second
28+
defaultRetryAttempts = 60
2529
)
2630

2731
type ValidateHubbleDropMetric struct {

0 commit comments

Comments
 (0)