Fixes in async test

code is cleaner
Merge pull request #9235 from ricardoquesada/async_fixes_test

Fixes in async test