In reply to dave_59:
Hi Dave,
Sorry for not being clear. I mean when I used module instead of program (as suggested by you in one of the comments), the test waited for timeout_fork process to finish which was not the case for program i.e. module code ended at time 100 while program at time 5. What property of the module makes it wait for the timeout_fork process to finish?