If the test times out in isOperationRunConcurrently, the receiver channel stops listening. The goroutine spawned in startOperationAndBlock then blocks forever on ch <- nil.
This commit updates startOperationAndBlock to use a select statement. It now waits for either the send to complete or the quit channel to be closed (signaling test completion). This ensures the goroutine exits cleanly even if the receiver is gone.
Signed-off-by: kkh <kkhdevs@gmail.com>
Currently, when a Kubelet Plugin is being added in the DesiredStateOfWorld,
a timestamp is saved in the PluginInfo. This timestamp is then updated on
subsequent plugin reregistrations.
The Reconciler, when it detects different timestamps for a Plugin in its
DesiredStateOfWorld and ActualStateOfWorld, it will then trigger a Plugin unregister
and then a new Plugin registration.
Basically, the timestamp is being used to detect whether or not a Plugin needs to
be reregistered or not. However, this can be an issue on Windows, where the time
measurements are not as fine-grained. time.Now() calls within the same ~1-15ms
window will have the same timestamp. This can mean that Plugin Reregistration events
can be missed on Windows [1]. Because of this, some of the Plugin registration unit
tests fail on Windows.
This commit updates the behaviour, instead of relying on different timestamps,
the Reconciler will check the set PluginInfo UUID to detect a Plugin Reregistration.
With this change, the unit tests mentioned above will also pass on Windows.
[1] https://github.com/golang/go/issues/8687