-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add e2e test for the NodeLatencyMonitor feature #6612
Merged
antoninbas
merged 14 commits into
antrea-io:main
from
Rupam-It:add-node-latency-monitor-tests
Sep 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c96dcde
Added e2e tests for NodeLatencyMonitor
Rupam-It d0affe0
This commit addresses feedback from the PR review and refines the e2e…
Rupam-It 4e3685d
nodelatencymonitor_test.go file is shifted to test/e2e directory
Rupam-It 06ab884
Add NodeLatencyMonitor tests
Rupam-It 9d7f653
Updated e2e tests for NodeLatencyMonitor
Rupam-It 4a750b7
making single test case
Rupam-It 1b8fd8a
NodeLatencyStats objects to make sure they are correct.
Rupam-It e9a8889
refine nodelatencystats test
Rupam-It 8d0f799
remove redundancy of codes & updates that more specific to Antrea fra…
Rupam-It 639aa6b
Update test/e2e/nodelatencymonitor_test.go
Rupam-It 09f8471
Update test/e2e/nodelatencymonitor_test.go
Rupam-It 3b0d16f
add defer function for mandatorily delete the nodelatencymonitor CR
Rupam-It 7ca1fce
update copywrite header and ci checks
Rupam-It 3465eea
update copywrite date
Rupam-It File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
// Copyright 2020 Antrea Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package e2e | ||
|
||
import ( | ||
// Standard library imports | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not a helpful comment, please remove it |
||
"context" | ||
"testing" | ||
"time" | ||
|
||
crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" | ||
"antrea.io/antrea/pkg/apis/stats/v1alpha1" | ||
"antrea.io/antrea/pkg/features" | ||
"github.com/stretchr/testify/require" | ||
|
||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/util/wait" | ||
|
||
crdv1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" | ||
"antrea.io/antrea/pkg/apis/stats/v1alpha1" | ||
"antrea.io/antrea/pkg/features" | ||
) | ||
|
||
func TestNodeLatencyMonitor(t *testing.T) { | ||
|
@@ -93,17 +109,17 @@ func TestNodeLatencyMonitor(t *testing.T) { | |
return true, nil | ||
} | ||
|
||
err = wait.PollImmediate(time.Second, 30*time.Second, func() (bool, error) { | ||
statsList, err := data.crdClient.StatsV1alpha1().NodeLatencyStats().List(context.TODO(), metav1.ListOptions{}) | ||
err = wait.PollUntilContextTimeout(context.TODO(), time.Second, 30*time.Second, false, func(ctx context.Context) (bool, error) { | ||
statsList, err := data.crdClient.StatsV1alpha1().NodeLatencyStats().List(ctx, metav1.ListOptions{}) | ||
if err != nil { | ||
return false, err | ||
} | ||
return validateNodeLatencyStats(statsList, true) | ||
}) | ||
require.NoError(t, err, "Failed to validate initial NodeLatencyStats") | ||
|
||
err = wait.PollImmediate(time.Second, 30*time.Second, func() (bool, error) { | ||
statsList, err := data.crdClient.StatsV1alpha1().NodeLatencyStats().List(context.TODO(), metav1.ListOptions{}) | ||
err = wait.PollUntilContextTimeout(context.TODO(), time.Second, 30*time.Second, false, func(ctx context.Context) (bool, error) { | ||
statsList, err := data.crdClient.StatsV1alpha1().NodeLatencyStats().List(ctx, metav1.ListOptions{}) | ||
if err != nil { | ||
return false, err | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the date is wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done