kezhuw commented on pull request #14140:
URL: https://github.com/apache/flink/pull/14140#issuecomment-733394480


   I think `StreamTaskTestHarness.waitForInputProcessing` play similar role as 
`StreamTaskMailboxTestHarness.processAll`. Current fix and 
`StreamTaskMailboxTestHarness.processAll` share one  assumption: default action 
will and only will be suspended after all available input has been processed. 
The main functionality difference between these two methods is that the latter 
guarantee mailbox is drained before returning. `MailboxExecutorImpl.isIdle` or 
similar could fill the hole if `StreamTaskTestHarness` needs that guarantee 
unfortunately.
   
   In my opinion, the key difference between `StreamTaskTestHarness` and 
`StreamTaskMailboxTestHarness` is threading model. With help from 
`StreamTaskMailboxTestHarness`, assertion codes and stream tasks execute in 
same thread, it is easy to get help from task 
execution(`MailboxProcessor.runMailboxStep`) without involved to concurrent 
realm. This is not possible with `StreamTaskTestHarness` which make it hard to 
probe and evaluate.
   
   That is all I have got now.
   
   @AHeise Thank you for pointing out the inappropriateness of 
`TaskMailbox.isMailboxThreadBlocked`.
   
   @AHeise @rkhachatryan Thank you for reviewing.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to