test for producer consumer pattern