Merge pull request #115617 from cyclinder/cyclinder1

close grpc server in test file to avoid goroutine leak
This commit is contained in:
Kubernetes Prow Robot 2023-02-10 07:39:30 -08:00 committed by GitHub
commit 161b00c639
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)