Skip to content

Commit cc1ba09

Browse files
authored
ci: add delay after link creation for test add remove static arp (#2968)
fix by adding delay after link creation
1 parent a77d016 commit cc1ba09

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

netlink/netlink_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package netlink
99
import (
1010
"net"
1111
"testing"
12+
"time"
1213

1314
"github.com/stretchr/testify/require"
1415
"golang.org/x/sys/unix"
@@ -285,6 +286,10 @@ func TestAddRemoveStaticArp(t *testing.T) {
285286
mac, _ := net.ParseMAC("aa:b3:4d:5e:e2:4a")
286287
nl := NewNetlink()
287288

289+
// wait for interface to fully come up
290+
// if it isn't fully up it might wipe the arp entry we're about to add
291+
time.Sleep(time.Millisecond * 100)
292+
288293
linkInfo := LinkInfo{
289294
Name: ifName,
290295
IPAddr: ip,
@@ -302,6 +307,9 @@ func TestAddRemoveStaticArp(t *testing.T) {
302307
MacAddress: mac,
303308
}
304309

310+
// ensure arp address remains for a period of time
311+
time.Sleep(time.Millisecond * 100)
312+
305313
err = nl.SetOrRemoveLinkAddress(linkInfo, REMOVE, NUD_INCOMPLETE)
306314
if err != nil {
307315
t.Errorf("ret val %v", err)

0 commit comments

Comments
 (0)