mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #115617 from cyclinder/cyclinder1
close grpc server in test file to avoid goroutine leak
This commit is contained in:
commit
161b00c639
@ -198,6 +198,9 @@ func Test_Run_Positive_Register(t *testing.T) {
|
|||||||
pluginName := fmt.Sprintf("example-plugin")
|
pluginName := fmt.Sprintf("example-plugin")
|
||||||
p := pluginwatcher.NewTestExamplePlugin(pluginName, registerapi.DevicePlugin, socketPath, supportedVersions...)
|
p := pluginwatcher.NewTestExamplePlugin(pluginName, registerapi.DevicePlugin, socketPath, supportedVersions...)
|
||||||
require.NoError(t, p.Serve("v1beta1", "v1beta2"))
|
require.NoError(t, p.Serve("v1beta1", "v1beta2"))
|
||||||
|
defer func() {
|
||||||
|
require.NoError(t, p.Stop())
|
||||||
|
}()
|
||||||
timestampBeforeRegistration := time.Now()
|
timestampBeforeRegistration := time.Now()
|
||||||
dsw.AddOrUpdatePlugin(socketPath)
|
dsw.AddOrUpdatePlugin(socketPath)
|
||||||
waitForRegistration(t, socketPath, timestampBeforeRegistration, asw)
|
waitForRegistration(t, socketPath, timestampBeforeRegistration, asw)
|
||||||
|
Loading…
Reference in New Issue
Block a user