mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
close grpc server in test file to avoid goroutine leak
Signed-off-by: cyclinder <kuocyclinder@gmail.com>
This commit is contained in:
parent
b0171f77f6
commit
1bdcd18bf6
@ -198,6 +198,9 @@ func Test_Run_Positive_Register(t *testing.T) {
|
||||
pluginName := fmt.Sprintf("example-plugin")
|
||||
p := pluginwatcher.NewTestExamplePlugin(pluginName, registerapi.DevicePlugin, socketPath, supportedVersions...)
|
||||
require.NoError(t, p.Serve("v1beta1", "v1beta2"))
|
||||
defer func() {
|
||||
require.NoError(t, p.Stop())
|
||||
}()
|
||||
timestampBeforeRegistration := time.Now()
|
||||
dsw.AddOrUpdatePlugin(socketPath)
|
||||
waitForRegistration(t, socketPath, timestampBeforeRegistration, asw)
|
||||
|
Loading…
Reference in New Issue
Block a user