-
Notifications
You must be signed in to change notification settings - Fork 244
backport: ci: add delay after link creation for test add remove static arp (#2968) #3556
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
base: release/v1.5
Are you sure you want to change the base?
Conversation
fix by adding delay after link creation
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.
Pull Request Overview
A backport PR to add delays in the static ARP test to ensure that the network interface is fully up before ARP entries are modified.
- Added the time package and inserted delays before and after setting the ARP entries.
- Updated comments to clarify the timing rationale in the test.
Comments suppressed due to low confidence (2)
netlink/netlink_test.go:291
- [nitpick] Consider replacing the hardcoded delay value with a clearly named constant (e.g., interfaceUpDelay) to improve readability and ease future adjustments.
time.Sleep(time.Millisecond * 100)
netlink/netlink_test.go:311
- [nitpick] Similarly, consider using a named constant (e.g., arpPersistenceDelay) for this delay to clarify its purpose and allow for easier configuration changes.
time.Sleep(time.Millisecond * 100)
/azp run Azure Container Networking PR |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -285,6 +286,10 @@ func TestAddRemoveStaticArp(t *testing.T) { | |||
mac, _ := net.ParseMAC("aa:b3:4d:5e:e2:4a") | |||
nl := NewNetlink() | |||
|
|||
// wait for interface to fully come up | |||
// if it isn't fully up it might wipe the arp entry we're about to add | |||
time.Sleep(time.Millisecond * 100) |
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.
Are we waiting for a specific state here? We should avoid this type of behavior and explicitly wait for a state of the netdev and timeout if the expected state is never seen.
The problem with this is it can result in flakes depending on several factors. Let’s be deterministic with this instead.
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.
Putting time.sleep is a flake waiting to happen. I pulled this from the merge queue.
This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days |
fix by adding delay after link creation
Reason for Change:
Backports #2968
Issue Fixed:
See above
Requirements:
Notes: