You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/22 14:54:11 UTC

[GitHub] [airflow] ashb commented on a change in pull request #15469: Fix incorrect order of messages in logs when using Elasticsearch

ashb commented on a change in pull request #15469:
URL: https://github.com/apache/airflow/pull/15469#discussion_r618476894



##########
File path: tests/providers/elasticsearch/log/test_es_task_handler.py
##########
@@ -151,6 +156,23 @@ def test_read_with_none_metadata(self):
         assert '1' == metadatas[0]['offset']
         assert timezone.parse(metadatas[0]['last_log_timestamp']) < pendulum.now()
 
+    def test_read_asctime_order(self):
+        another_test_message = 'another message'
+        outdated_body = {
+            'asctime': '2020-12-24 19:25:00,862',
+            'message': another_test_message,
+            'log_id': self.LOG_ID,
+            'offset': 1,
+        }
+        self.es.index(index=self.index_name, doc_type=self.doc_type, body=outdated_body, id=1)
+        logs, metadatas = self.es_task_handler.read(self.ti, 1)
+        assert 1 == len(logs)

Review comment:
       If there is only a single log entry comming back, we aren't testing the sorting continues to work.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org