wilfred-s commented on code in PR #1034:
URL: https://github.com/apache/yunikorn-k8shim/pull/1034#discussion_r3331579979
##########
pkg/dispatcher/dispatch_test.go:
##########
@@ -302,6 +306,23 @@ func TestExceedAsyncDispatchLimit(t *testing.T) {
}
func createDispatcher() {
+ if dispatcher != nil {
+ d := dispatcher
+ if d.isRunning() {
+ Stop()
+ }
+ if d.asyncDispatchCount.Load() > 0 {
+ waitTimeout := d.dispatchTimeout +
d.asyncDispatchCheckInterval + time.Second
+ if waitTimeout > maxTestAsyncDispatchDrain {
+ waitTimeout = maxTestAsyncDispatchDrain
+ }
+ if err := utils.WaitForCondition(func() bool {
+ return d.asyncDispatchCount.Load() == 0
+ }, testAsyncDispatchPollPeriod, waitTimeout); err !=
nil {
+ fmt.Printf("warning: async dispatch did not
drain before re-init: %v\n", err)
Review Comment:
This should no be using a `fmt.Printf()`, logging is the minimum we need to
do. Should we fail the test if this happens?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]