Skip to content

Commit 6efb151

Browse files
committed
Specify mapping to get reliable failure
1 parent e81906f commit 6efb151

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test_elasticsearch_serverless/test_async/test_server/test_helpers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ async def test_error_is_raised(self, async_client):
364364
await helpers.async_bulk(async_client, [{"a": 42}, {"a": "c"}], index="i")
365365

366366
async def test_ignore_error_if_raised(self, async_client):
367+
await async_client.indices.create(
368+
index="i", mappings={"properties": {"a": {"type": "long"}}}
369+
)
370+
367371
# ignore the status code 400 in tuple
368372
await helpers.async_bulk(
369373
async_client, [{"a": 42}, {"a": "c"}], index="i", ignore_status=(400,)

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)