Merge "Refactor TrustTests waiting into common function." into tm-dev