code: def test_set_context(self, ti):
      self.es_task_handler.set_context(ti)
      assert self.es_task_handler.mark_end_on_close
  
imports: from __future__ import annotations
  import json
  import logging
  import os
  import re
  import shutil
  from io import StringIO
  from pathlib import Path
  from unittest import mock
  from urllib.parse import quote
  import elasticsearch
  import pendulum
  import pytest
  from airflow.configuration import conf
  from airflow.providers.elasticsearch.log.es_response import ElasticSearchResponse
  from airflow.providers.elasticsearch.log.es_task_handler import VALID_ES_CONFIG_KEYS, ElasticsearchTaskHandler, get_es_kwargs_from_config, getattr_nested
  from airflow.utils import timezone
  from airflow.utils.state import DagRunState, TaskInstanceState
  from airflow.utils.timezone import datetime
  from tests.test_utils.config import conf_vars
  from tests.test_utils.db import clear_db_dags, clear_db_runs
  from .elasticmock import elasticmock
  from .elasticmock.utilities import SearchFailedException
label_desc: Use image node_id 21 for calling the TestElasticsearchTaskHandler obj's underlying member method code with example usage: obj.test_set_context(ti) without return types