Refine test code for blockmanager is null