Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
fix: integration tests issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zac-li committed Aug 7, 2023
1 parent 5c14276 commit 933e705
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/integration/jcloud/test_basic_app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import json
import os
import time

import pytest
Expand Down Expand Up @@ -113,19 +114,24 @@ async def _test_tracing(app_id: str):


async def _test_job(app_id: str):
asyncio.sleep(30)
await asyncio.sleep(30)
create_job_url = f"https://{app_id}.wolf.jina.ai/my_job"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Bearer {os.environ['JINA_AUTH_TOKEN']}",
}

response = requests.post(
create_job_url, data=json.dumps({"param1": "hello", "param2": "world"})
create_job_url, json={"param1": "hello", "param2": "world"}, headers=headers
)
assert response.status_code == 200

asyncio.sleep(30)
await asyncio.sleep(30)

jobs = await CloudFlow(flow_id=app_id).list_resources("jobs")
assert (
len(jobs) > 1
len(jobs) > 0
and jobs[0]['name'].startswith('my-job-')
and jobs[0]['status']['conditions'][-1]['type'] == 'Complete'
)

0 comments on commit 933e705

Please sign in to comment.