fix the test case not to time out write procedure