@@ -329,8 +329,8 @@ def test_search_body(instrument, elasticapm_client, elasticsearch):
329
329
spans = elasticapm_client .spans_for_transaction (transaction )
330
330
assert len (spans ) == 1
331
331
span = spans [0 ]
332
- # Depending on ES_VERSION, could be /_all/_search or /_search
333
- assert span ["name" ] in ("ES GET /_search" , "ES GET /_all/_search" )
332
+ # Depending on ES_VERSION, could be /_all/_search or /_search, and GET or POST
333
+ assert span ["name" ] in ("ES GET /_search" , "ES GET /_all/_search" , "ES POST /_search" )
334
334
assert span ["type" ] == "db"
335
335
assert span ["subtype" ] == "elasticsearch"
336
336
assert span ["action" ] == "query"
@@ -380,7 +380,9 @@ def test_search_both(instrument, elasticapm_client, elasticsearch):
380
380
spans = elasticapm_client .spans_for_transaction (transaction )
381
381
assert len (spans ) == 1
382
382
span = spans [0 ]
383
- assert span ["name" ] == "ES GET /tweets/_search"
383
+ # Starting in 7.6.0, these turned into POST instead of GET. That detail is
384
+ # unimportant for these tests.
385
+ assert span ["name" ] in ("ES GET /tweets/_search" , "ES POST /tweets/_search" )
384
386
assert span ["type" ] == "db"
385
387
assert span ["subtype" ] == "elasticsearch"
386
388
assert span ["action" ] == "query"
@@ -493,7 +495,9 @@ def test_multiple_indexes(instrument, elasticapm_client, elasticsearch):
493
495
spans = elasticapm_client .spans_for_transaction (transaction )
494
496
assert len (spans ) == 1
495
497
span = spans [0 ]
496
- assert span ["name" ] == "ES GET /tweets,snaps/_search"
498
+ # Starting in 7.6.0, these turned into POST instead of GET. That detail is
499
+ # unimportant for these tests.
500
+ assert span ["name" ] in ("ES GET /tweets,snaps/_search" , "ES POST /tweets,snaps/_search" )
497
501
assert span ["type" ] == "db"
498
502
assert span ["subtype" ] == "elasticsearch"
499
503
assert span ["action" ] == "query"
0 commit comments