Fix tests because of the behavior or setImmediate