Integration test for multiple threads