tylerbertrand commented on PR #4716:
URL: https://github.com/apache/eventmesh/pull/4716#issuecomment-1879219077

   Ok, I realized the problem is that the assertions were actually being 
executed, but they were failing in another thread, so they did not fail the 
test.
   
   To get around this, I pushed a commit that restructures the test to use 
Mockito to verify that the `onChanged()` method was called for the file under 
test. This correctly tests whether the change to the file was detected or not.
   
   The one quirk is that it seems to take a bit for the `WatchService.take()` 
method to pick up the change to the file - it was about 10s on my machine. I 
added a 15s timeout to the `Mockito.verify()` call to account for this. With 
the timeout configured, the test will pass as soon as the `onChange()` method 
is called - it doesn't need to wait the full 15s if it is called sooner.
   
   Let me know what you think. 


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to