Test generator to replace thread