Skip to content

Commit 8260190

Browse files
committed
test: hardcode sys.platform, add sleep
1 parent 2a6d95a commit 8260190

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/integration/test_splunk_rest_client.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import context
1818
import pytest
1919
import solnlib
20-
import sys
20+
from time import sleep
2121
from splunklib import binding
2222
from solnlib import splunk_rest_client as rest_client
2323

@@ -26,7 +26,7 @@
2626

2727
def test_rest_client_user_agent():
2828
test_url = r'search index = _internal uri_path="*/servicesNS/nobody/test_app/some/unexisting/url"'
29-
user_agent = f"solnlib/{solnlib.__version__} rest-client {sys.platform}"
29+
user_agent = f"solnlib/{solnlib.__version__} rest-client linux"
3030
session_key = context.get_session_key()
3131
wrong_url = r"some/unexisting/url"
3232
rc = rest_client.SplunkRestClient(
@@ -40,6 +40,10 @@ def test_rest_client_user_agent():
4040
with pytest.raises(binding.HTTPError):
4141
rc.get(wrong_url)
4242

43-
search_results = search(session_key, test_url)
44-
assert len(search_results) == 1
43+
for i in range(50):
44+
search_results = search(session_key, test_url)
45+
if len(search_results) > 0:
46+
break
47+
sleep(0.5)
48+
4549
assert user_agent in search_results[0]["_raw"]

0 commit comments

Comments
 (0)