Skip to content

Commit 9d893c8

Browse files
committed
DRA: fix failing test
Added error assertion for NodePrepareResources call unveiled "rpc error: code = DeadlineExceeded desc = context deadline exceeded" failure in the TestGRPCConnIsReused test. Setting clientCallTimeout field when creating plugin should fix it.
1 parent b8dcc2c commit 9d893c8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/kubelet/cm/dra/plugin/client_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ func TestGRPCConnIsReused(t *testing.T) {
109109
m := sync.Mutex{}
110110

111111
p := &Plugin{
112-
backgroundCtx: ctx,
113-
endpoint: addr,
112+
backgroundCtx: ctx,
113+
endpoint: addr,
114+
clientCallTimeout: defaultClientCallTimeout,
114115
}
115116

116117
conn, err := p.getOrCreateGRPCConn()
@@ -148,7 +149,8 @@ func TestGRPCConnIsReused(t *testing.T) {
148149
},
149150
},
150151
}
151-
client.NodePrepareResources(context.TODO(), req)
152+
_, err = client.NodePrepareResources(context.TODO(), req)
153+
assert.NoError(t, err)
152154

153155
client.mutex.Lock()
154156
conn := client.conn

0 commit comments

Comments
 (0)