I've got a test that runs the plugin server in a goroutine and fetches the reattach config from the server using ServeTestConfig.ReattachConfigCh, passing it to the client. The problem is that the server and client are versioned, so the client config has a map of VersionedPlugins while Plugins is empty. When the client is created using the reattach config, Client.Start exits early by calling c.reattach(), skipping the part where the plugin version is determined and leaving ClientConfig.Plugins set to nil. The client is therefore not initialized correctly and can't be used.
I found that executing the version handshake when reattaching solves my problem. Before opening a PR I wanted to ask if this is the proper way to address this issue, or if I'm missing something else.
lovromazgon@a3d2cd0

I've got a test that runs the plugin server in a goroutine and fetches the reattach config from the server using
ServeTestConfig.ReattachConfigCh, passing it to the client. The problem is that the server and client are versioned, so the client config has a map ofVersionedPluginswhilePluginsis empty. When the client is created using the reattach config,Client.Startexits early by callingc.reattach(), skipping the part where the plugin version is determined and leavingClientConfig.Pluginsset tonil. The client is therefore not initialized correctly and can't be used.I found that executing the version handshake when reattaching solves my problem. Before opening a PR I wanted to ask if this is the proper way to address this issue, or if I'm missing something else.
lovromazgon@a3d2cd0