Skip to content

Conversation

alexbozhenko
Copy link
Member

@alexbozhenko alexbozhenko commented Sep 4, 2025

If we want to test the order in which objects are inserted, we want to insert them sequentially.
asyncio.gather doc say:

Coroutines will be wrapped in a future and scheduled in the event loop. They will not necessarily be scheduled in the same order as passed in.

Starting with this PR the test started to fail, because order
nats-io/nats-server#7125

pipenv install --dev
export DEBUG_NATS_TEST=true
pipenv run pytest tests/test_js.py::ObjectStoreTest::test_object_list -v -s
...
[154637] 2025/09/03 17:46:14.437434 [TRC] 127.0.0.1:40204 - cid:5 - <<- MSG_PAYLOAD: ["AAA"]
[154637] 2025/09/03 17:46:14.437473 [TRC] 127.0.0.1:40204 - cid:5 - <<- MSG_PAYLOAD: ["CCC"]
[154637] 2025/09/03 17:46:14.437489 [TRC] 127.0.0.1:40204 - cid:5 - <<- MSG_PAYLOAD: ["DDD"]
[154637] 2025/09/03 17:46:14.437519 [TRC] 127.0.0.1:40204 - cid:5 - <<- MSG_PAYLOAD: ["BBB"]

Before the server PR, in a single-server set up we would serve the JS.API requests sequentially:
https://github.com/nats-io/nats-server/pull/7125/files#diff-9c075c47b0690a821ad35caa26308b69adeb132042f062eef75513db2a26638aL878

Now, after the server PR, we put concurrently sent requests on the queue, and correctly get "undefined, out of order execution"

@wallyqs wallyqs merged commit 1520289 into nats-io:main Sep 4, 2025
19 checks passed
@alexbozhenko alexbozhenko mentioned this pull request Sep 4, 2025
5 tasks
wallyqs pushed a commit that referenced this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants