You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the CLASS_SERVER mode, startup_teardown() indeeds starts a server, however that server is unused. Instead the tests connect to the server specified in ARKOUDA_SERVER_HOST. If there isn’t one, the tests hang.
In the GLOBAL_SERVER mode, I do not see that the server starts at all. Again, the tests hang. I think this is not the intended behavior.
benchmark.ini defines ARKOUDA_RUNNING_MODE=CLASS_SERVER whereas benchmark_v2/conftest.py defaults to GLOBAL_SERVER if ARKOUDA_RUNNING_MODE is unset. This is confusing. benchmark.ini also defines the host and the port, with benchmark_v2/conftest.py again providing the defaults, this time consistently.
My suggestion is to remove these settings from benchmark.ini, relying directly on benchmark_v2/conftest.py.
Within Python, the information from startup_teardown() to connect() flows as a string with the host name. If two servers are launched, for example, on localhost, then it is easy to use one instead of the other. The issue is more obvious when servers are launched, for example, on two different compute nodes of a bigger system.
I also have a fear that we may accidentally overwrite the serverConnectionInfo file because two server launches use the same location, e.g., when launching a server per class. Not sure this is a real issue though, as hopefully we delete this file after we read it. (???)
Under normal, single-process pytest runs with a module-scoped fixture, you’ll only ever have one Arkouda server up at a time:
Module scope → one start/stop per module
Pytest will call your arkouda_server fixture once at the top of each test module that needs it, then tear it down before moving on.
Because teardown happens before the next module’s setup, there’s never any overlap within a single pytest worker.
Session scope → one start/stop per entire run
If you bump your fixture to scope="session", then you get one start at the very beginning and one stop at the very end—still serial, still no overlap.
The only time you’ll see multiple servers live at once is if you run pytest in parallel with something like pytest-xdist (multiple worker processes). Each worker is its own Python process and will independently:
import your fixtures
start its own server (on the same port, which will actually cause bind errors unless you adjust it)
tear it down
So by default, single-process → no concurrent servers. But if you parallelize across N xdist workers, you’ll end up with N “simultaneous” server startups (and likely port conflicts).
For a more general case, I suggest that the default returned by get_arkouda_server_info_file() contains some unique string, perhaps uuid.uuid4().hex[:4], ex. "ak-server-info.1234" .
Activity
ajpotts commentedon Jan 8, 2025
@vasslitvinov reported the following concerns:
In the CLASS_SERVER mode, startup_teardown() indeeds starts a server, however that server is unused. Instead the tests connect to the server specified in ARKOUDA_SERVER_HOST. If there isn’t one, the tests hang.
In the GLOBAL_SERVER mode, I do not see that the server starts at all. Again, the tests hang. I think this is not the intended behavior.
benchmark.ini defines ARKOUDA_RUNNING_MODE=CLASS_SERVER whereas benchmark_v2/conftest.py defaults to GLOBAL_SERVER if ARKOUDA_RUNNING_MODE is unset. This is confusing. benchmark.ini also defines the host and the port, with benchmark_v2/conftest.py again providing the defaults, this time consistently.
My suggestion is to remove these settings from benchmark.ini, relying directly on benchmark_v2/conftest.py.
vasslitvinov commentedon Jan 8, 2025
Within Python, the information from
startup_teardown()toconnect()flows as a string with the host name. If two servers are launched, for example, onlocalhost, then it is easy to use one instead of the other. The issue is more obvious when servers are launched, for example, on two different compute nodes of a bigger system.I also have a fear that we may accidentally overwrite the
serverConnectionInfofile because two server launches use the same location, e.g., when launching a server per class. Not sure this is a real issue though, as hopefully we delete this file after we read it. (???)Closes Bears-R-Us#3964: Refactor benchmark handling of running mode
Closes Bears-R-Us#3964: Refactor benchmark handling of running mode
Closes Bears-R-Us#3964: Refactor benchmark handling of running mode
Part of Bears-R-Us#3964: Refactor benchmark handling of running mode
ajpotts commentedon May 1, 2025
I believe in GLOBAL_SERVER mode it's not supposed to start a server, but rather connect to an existing server.
Part of Bears-R-Us#3964: Refactor benchmark handling of running mode
ajpotts commentedon May 1, 2025
In regards to your concern about the serverConnectionInfo file, this section of the arkouda code:
Indicates that it will be deleted upon server shutdown.
ajpotts commentedon May 1, 2025
According to ChatGPT:
ajpotts commentedon May 1, 2025
So as long as we're not running with
xdist, it should be OK....vasslitvinov commentedon May 1, 2025
That's reassuring, thanks for looking into it!
For a more general case, I suggest that the default returned by
get_arkouda_server_info_file()contains some unique string, perhapsuuid.uuid4().hex[:4], ex."ak-server-info.1234".Part of Bears-R-Us#3964: Refactor benchmark handling of running mode
7 remaining items
Part 2 of #3964: Refactor benchmark handling of running mode (#4373)
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of Bears-R-Us#3964: Refactor benchmark handling of running mode
Part 3 of #3964: Refactor benchmark handling of running mode (#4385)
Closes Bears-R-Us#3964: Refactor benchmark handling of running mode.
Closes Bears-R-Us#3964: Refactor benchmark handling of running mode.
Closes #3964: Refactor benchmark handling of running mode. (#4471)