16
16
# under the License.
17
17
18
18
import asyncio
19
+ import sys
19
20
from datetime import datetime , timedelta , timezone
20
21
from unittest .mock import MagicMock , call , patch
21
22
30
31
pytestmark = [pytest .mark .asyncio ]
31
32
32
33
34
+ async_bulk_xfail = pytest .mark .xfail (
35
+ sys .version_info < (3 , 11 ), reason = "Investigated in issue #62"
36
+ )
37
+
38
+
33
39
class AsyncMock (MagicMock ):
34
40
async def __call__ (self , * args , ** kwargs ):
35
41
return super (AsyncMock , self ).__call__ (* args , ** kwargs )
@@ -76,6 +82,7 @@ async def test_actions_remain_unchanged(self, async_client):
76
82
assert ok
77
83
assert [{"_id" : 1 }, {"_id" : 2 }] == actions
78
84
85
+ @async_bulk_xfail
79
86
async def test_all_documents_get_inserted (self , async_client ):
80
87
docs = [{"answer" : x , "_id" : x } for x in range (100 )]
81
88
async for ok , item in helpers .async_streaming_bulk (
@@ -88,6 +95,7 @@ async def test_all_documents_get_inserted(self, async_client):
88
95
"_source"
89
96
]
90
97
98
+ @async_bulk_xfail
91
99
async def test_documents_data_types (self , async_client ):
92
100
async def async_gen ():
93
101
for x in range (100 ):
@@ -306,6 +314,7 @@ async def test_bulk_works_with_single_item(self, async_client):
306
314
"_source"
307
315
]
308
316
317
+ @async_bulk_xfail
309
318
async def test_all_documents_get_inserted (self , async_client ):
310
319
docs = [{"answer" : x , "_id" : x } for x in range (100 )]
311
320
success , failed = await helpers .async_bulk (
@@ -319,6 +328,7 @@ async def test_all_documents_get_inserted(self, async_client):
319
328
"_source"
320
329
]
321
330
331
+ @async_bulk_xfail
322
332
async def test_stats_only_reports_numbers (self , async_client ):
323
333
docs = [{"answer" : x } for x in range (100 )]
324
334
success , failed = await helpers .async_bulk (
@@ -454,6 +464,7 @@ async def scan_teardown(async_client):
454
464
455
465
456
466
class TestScan (object ):
467
+ @async_bulk_xfail
457
468
async def test_order_can_be_preserved (self , async_client , scan_teardown ):
458
469
bulk = []
459
470
for x in range (100 ):
@@ -886,6 +897,7 @@ async def reindex_setup(async_client):
886
897
887
898
888
899
class TestReindex (object ):
900
+ @async_bulk_xfail
889
901
async def test_reindex_passes_kwargs_to_scan_and_bulk (
890
902
self , async_client , reindex_setup
891
903
):
@@ -907,6 +919,7 @@ async def test_reindex_passes_kwargs_to_scan_and_bulk(
907
919
await async_client .get (index = "prod_index" , id = 42 )
908
920
)["_source" ]
909
921
922
+ @async_bulk_xfail
910
923
async def test_reindex_accepts_a_query (self , async_client , reindex_setup ):
911
924
await helpers .async_reindex (
912
925
async_client ,
@@ -926,6 +939,7 @@ async def test_reindex_accepts_a_query(self, async_client, reindex_setup):
926
939
await async_client .get (index = "prod_index" , id = 42 )
927
940
)["_source" ]
928
941
942
+ @async_bulk_xfail
929
943
async def test_all_documents_get_moved (self , async_client , reindex_setup ):
930
944
await helpers .async_reindex (
931
945
async_client , "test_index" , "prod_index" , bulk_kwargs = {"refresh" : True }
@@ -976,6 +990,7 @@ async def reindex_data_stream_setup(async_client):
976
990
977
991
class TestAsyncDataStreamReindex (object ):
978
992
@pytest .mark .parametrize ("op_type" , [None , "create" ])
993
+ @async_bulk_xfail
979
994
async def test_reindex_index_datastream (
980
995
self , op_type , async_client , reindex_data_stream_setup
981
996
):
@@ -995,6 +1010,7 @@ async def test_reindex_index_datastream(
995
1010
]
996
1011
)
997
1012
1013
+ @async_bulk_xfail
998
1014
async def test_reindex_index_datastream_op_type_index (
999
1015
self , async_client , reindex_data_stream_setup
1000
1016
):
0 commit comments