Thanks Masatake Iwasaki for the interest and useful comments.
I could see, again #triggerBlockReportForTests can immediately return before acknowledging the ActiveNN. Below is the sequence:
1=> During startUp(), it will call dn.getAllBpOs().get(0).triggerBlockReportForTests() and initializes final long oldBlockReportTime = scheduler.nextBlockReportTime;
3=> Starting of the actor thread will call the function BPServiceActor#connectToNNAndHandshake()
Now, #scheduleBlockReport function call will update nextBlockReportTime = monotonicNow();. This will again stops waiting period of #triggerBlockReportForTests and continue to the unit test cases, then fall into similar error situation.
IMHO like you mentioned, two times #triggerBlockReportForTests will make the tests more consistent. I'm attaching a patch showing the changes, please review the patch again. Thanks!