core: fix hang in test