add timeout to queue_receive and update test code for it