Skip to content

Commit a63e72d

Browse files
committed
Remove xfails as tests appear to pass now
1 parent 41f4ef7 commit a63e72d

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

test_elasticsearch_serverless/test_async/test_server/test_helpers.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
pytestmark = [pytest.mark.asyncio]
3232

3333

34-
async_bulk_xfail = pytest.mark.xfail(
35-
sys.version_info < (3, 11), reason="Investigated in issue #62"
36-
)
37-
38-
3934
class AsyncMock(MagicMock):
4035
async def __call__(self, *args, **kwargs):
4136
return super(AsyncMock, self).__call__(*args, **kwargs)
@@ -82,7 +77,6 @@ async def test_actions_remain_unchanged(self, async_client):
8277
assert ok
8378
assert [{"_id": 1}, {"_id": 2}] == actions
8479

85-
@async_bulk_xfail
8680
async def test_all_documents_get_inserted(self, async_client):
8781
docs = [{"answer": x, "_id": x} for x in range(100)]
8882
async for ok, item in helpers.async_streaming_bulk(
@@ -95,7 +89,6 @@ async def test_all_documents_get_inserted(self, async_client):
9589
"_source"
9690
]
9791

98-
@async_bulk_xfail
9992
async def test_documents_data_types(self, async_client):
10093
async def async_gen():
10194
for x in range(100):
@@ -314,7 +307,6 @@ async def test_bulk_works_with_single_item(self, async_client):
314307
"_source"
315308
]
316309

317-
@async_bulk_xfail
318310
async def test_all_documents_get_inserted(self, async_client):
319311
docs = [{"answer": x, "_id": x} for x in range(100)]
320312
success, failed = await helpers.async_bulk(
@@ -328,7 +320,6 @@ async def test_all_documents_get_inserted(self, async_client):
328320
"_source"
329321
]
330322

331-
@async_bulk_xfail
332323
async def test_stats_only_reports_numbers(self, async_client):
333324
docs = [{"answer": x} for x in range(100)]
334325
success, failed = await helpers.async_bulk(
@@ -369,6 +360,10 @@ async def test_error_is_raised(self, async_client):
369360
await helpers.async_bulk(async_client, [{"a": 42}, {"a": "c"}], index="i")
370361

371362
async def test_ignore_error_if_raised(self, async_client):
363+
await async_client.indices.create(
364+
index="i", mappings={"properties": {"a": {"type": "long"}}}
365+
)
366+
372367
# ignore the status code 400 in tuple
373368
await helpers.async_bulk(
374369
async_client, [{"a": 42}, {"a": "c"}], index="i", ignore_status=(400,)
@@ -464,7 +459,6 @@ async def scan_teardown(async_client):
464459

465460

466461
class TestScan(object):
467-
@async_bulk_xfail
468462
async def test_order_can_be_preserved(self, async_client, scan_teardown):
469463
bulk = []
470464
for x in range(100):
@@ -486,7 +480,6 @@ async def test_order_can_be_preserved(self, async_client, scan_teardown):
486480
assert list(map(str, range(100))) == list(d["_id"] for d in docs)
487481
assert list(range(100)) == list(d["_source"]["answer"] for d in docs)
488482

489-
@async_bulk_xfail
490483
async def test_all_documents_are_read(self, async_client, scan_teardown):
491484
bulk = []
492485
for x in range(100):
@@ -898,7 +891,6 @@ async def reindex_setup(async_client):
898891

899892

900893
class TestReindex(object):
901-
@async_bulk_xfail
902894
async def test_reindex_passes_kwargs_to_scan_and_bulk(
903895
self, async_client, reindex_setup
904896
):
@@ -920,7 +912,6 @@ async def test_reindex_passes_kwargs_to_scan_and_bulk(
920912
await async_client.get(index="prod_index", id=42)
921913
)["_source"]
922914

923-
@async_bulk_xfail
924915
async def test_reindex_accepts_a_query(self, async_client, reindex_setup):
925916
await helpers.async_reindex(
926917
async_client,
@@ -940,7 +931,6 @@ async def test_reindex_accepts_a_query(self, async_client, reindex_setup):
940931
await async_client.get(index="prod_index", id=42)
941932
)["_source"]
942933

943-
@async_bulk_xfail
944934
async def test_all_documents_get_moved(self, async_client, reindex_setup):
945935
await helpers.async_reindex(
946936
async_client, "test_index", "prod_index", bulk_kwargs={"refresh": True}
@@ -991,7 +981,6 @@ async def reindex_data_stream_setup(async_client):
991981

992982
class TestAsyncDataStreamReindex(object):
993983
@pytest.mark.parametrize("op_type", [None, "create"])
994-
@async_bulk_xfail
995984
async def test_reindex_index_datastream(
996985
self, op_type, async_client, reindex_data_stream_setup
997986
):
@@ -1011,7 +1000,6 @@ async def test_reindex_index_datastream(
10111000
]
10121001
)
10131002

1014-
@async_bulk_xfail
10151003
async def test_reindex_index_datastream_op_type_index(
10161004
self, async_client, reindex_data_stream_setup
10171005
):

test_elasticsearch_serverless/test_server/test_helpers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ def test_error_is_raised(sync_client):
356356

357357

358358
def test_ignore_error_if_raised(sync_client):
359+
sync_client.indices.create(
360+
index="i", mappings={"properties": {"a": {"type": "long"}}}
361+
)
362+
359363
# ignore the status code 400 in tuple
360364
helpers.bulk(sync_client, [{"a": 42}, {"a": "c"}], index="i", ignore_status=(400,))
361365

0 commit comments

Comments
 (0)