[TEST] Move the waiting for pending tasks to helper methods and let the percolator and update mapping test use these helper methods.