Restored correct test for sync with wait