Fix functional tests

This PR try to fix the intermittent functional tests failure.