tests and code for 'fork template from poll'