@@ -329,8 +329,8 @@ def test_search_body(instrument, elasticapm_client, elasticsearch):
329329 spans = elasticapm_client .spans_for_transaction (transaction )
330330 assert len (spans ) == 1
331331 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" )
334334 assert span ["type" ] == "db"
335335 assert span ["subtype" ] == "elasticsearch"
336336 assert span ["action" ] == "query"
@@ -380,7 +380,9 @@ def test_search_both(instrument, elasticapm_client, elasticsearch):
380380 spans = elasticapm_client .spans_for_transaction (transaction )
381381 assert len (spans ) == 1
382382 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" )
384386 assert span ["type" ] == "db"
385387 assert span ["subtype" ] == "elasticsearch"
386388 assert span ["action" ] == "query"
@@ -493,7 +495,9 @@ def test_multiple_indexes(instrument, elasticapm_client, elasticsearch):
493495 spans = elasticapm_client .spans_for_transaction (transaction )
494496 assert len (spans ) == 1
495497 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" )
497501 assert span ["type" ] == "db"
498502 assert span ["subtype" ] == "elasticsearch"
499503 assert span ["action" ] == "query"
0 commit comments