added wait_while(condition, timeout)
updated managed context tests