test: flush before close