fix: job id should be returned only if event_delivery is not direct (#7540)
This commit is contained in:
parent
59a7440045
commit
0185f74276
2 changed files with 3 additions and 2 deletions
|
|
@ -199,7 +199,7 @@ async def build_flow(
|
|||
)
|
||||
|
||||
# This is required to support FE tests - we need to be able to set the event delivery to direct
|
||||
if event_delivery == EventDeliveryType.DIRECT:
|
||||
if event_delivery != EventDeliveryType.DIRECT:
|
||||
return {"job_id": job_id}
|
||||
return await get_flow_events_response(
|
||||
job_id=job_id,
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ async def test_build_flow_polling(client, json_memory_chatbot_no_llm, logged_in_
|
|||
|
||||
# Start the build and get job_id
|
||||
build_response = await build_flow(client, flow_id, logged_in_headers)
|
||||
assert "job_id" in build_response, f"Expected job_id in build_response, got {build_response}"
|
||||
job_id = build_response["job_id"]
|
||||
assert job_id is not None
|
||||
|
||||
|
|
@ -166,7 +167,7 @@ async def test_build_flow_polling(client, json_memory_chatbot_no_llm, logged_in_
|
|||
max_sleeps = 100
|
||||
while True:
|
||||
response = await self.client.get(
|
||||
f"api/v1/build/{self.job_id}/events?stream=false", headers=self.headers
|
||||
f"api/v1/build/{self.job_id}/events?event_delivery=polling", headers=self.headers
|
||||
)
|
||||
assert response.status_code == codes.OK
|
||||
data = response.json()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue