Skip to content

Commit

Permalink
fix(daemon): attempt to fix idle timeout test
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Dec 6, 2024
1 parent 06bc8cf commit 70b502d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pkg/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,19 @@ func TestMain(m *testing.M) {
}

func TestIdleTimeout(t *testing.T) {
c, err := net.Dial("tcp", testDaemon.addr)
if err != nil {
t.Fatal(err)
var err error
var c net.Conn
for {
c, err = net.Dial("tcp", testDaemon.addr)
if err != nil {
t.Fatal(err)
}
if testDaemon.conns.Size() != 0 {
break
}
time.Sleep(10 * time.Millisecond)
}
time.Sleep(time.Second)
time.Sleep(2 * time.Second)
_, err = readPktline(c)
if err == nil {
t.Errorf("expected error, got nil")
Expand Down

0 comments on commit 70b502d

Please sign in to comment.