Skip to content

Commit

Permalink
ci: add delay after link creation for test add remove static arp (#2968)
Browse files Browse the repository at this point in the history
fix by adding delay after link creation
  • Loading branch information
QxBytes authored Sep 15, 2024
1 parent a77d016 commit cc1ba09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions netlink/netlink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package netlink
import (
"net"
"testing"
"time"

"github.com/stretchr/testify/require"
"golang.org/x/sys/unix"
Expand Down Expand Up @@ -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)

linkInfo := LinkInfo{
Name: ifName,
IPAddr: ip,
Expand All @@ -302,6 +307,9 @@ func TestAddRemoveStaticArp(t *testing.T) {
MacAddress: mac,
}

// ensure arp address remains for a period of time
time.Sleep(time.Millisecond * 100)

err = nl.SetOrRemoveLinkAddress(linkInfo, REMOVE, NUD_INCOMPLETE)
if err != nil {
t.Errorf("ret val %v", err)
Expand Down

0 comments on commit cc1ba09

Please sign in to comment.