Add truncate code in batch test