add test and fix bug of infinite loop of running trace when wrapper condition is blank