Fix tests after change flush_writes method