Solved multithreaded selector event processing issue. The test function now handles errors more elegantly.