Using waitForMixed instead of Thread.sleep

Signed-off-by: Tsuyoshi Ozawa <ozawa.tsuyoshi@gmail.com>