Commit 4ba1b1e6 authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

test(fm): flush the core subscription before FM publishes

subscribe() only queues the SUB on the client, so on a slow runner FM's
JetStream publish could reach the server first and the core subscriber
never saw it, timing out after 5 s. Flush to make the server register it.
parent 8780d719
Loading
Loading
Loading
Loading
Loading
+1 −0
Changes for tests/integration/test_nats_handoff.py: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ async def test_fm_result_reaches_a_core_subscriber() -> None:
    await publisher.connect()
    srm = await nats.connect(URL)
    subscription = await srm.subscribe(SUBJECT_FM_COMPLETED)
    await srm.flush()  # the server must know the subscription before FM publishes
    marker = str(uuid4())
    try:
        await publisher.publish(SUBJECT_FM_COMPLETED, {"operation_id": marker})