From cc1ba097c7b434f9cfef7f89dd992189d35052d8 Mon Sep 17 00:00:00 2001 From: Alexander <39818795+QxBytes@users.noreply.github.com> Date: Sun, 15 Sep 2024 13:17:34 -0700 Subject: [PATCH] ci: add delay after link creation for test add remove static arp (#2968) fix by adding delay after link creation --- netlink/netlink_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netlink/netlink_test.go b/netlink/netlink_test.go index d5586f093..28f9997b4 100644 --- a/netlink/netlink_test.go +++ b/netlink/netlink_test.go @@ -9,6 +9,7 @@ package netlink import ( "net" "testing" + "time" "github.com/stretchr/testify/require" "golang.org/x/sys/unix" @@ -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, @@ -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)