Skip to content

updates to re-enable pytest test harness - #374

Merged
mhmerrill merged 2 commits into
Bears-R-Us:masterfrom
hokiegeek2:371_reverse_some_recent_pytest-based_test_harness_changes
May 18, 2020
Merged

mhmerrill merged 2 commits into
Bears-R-Us:masterfrom
hokiegeek2:371_reverse_some_recent_pytest-based_test_harness_changes

Conversation

@hokiegeek2

Copy link
Copy Markdown
Contributor

No description provided.

@mhmerrill mhmerrill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@mhmerrill
mhmerrill merged commit b95cc26 into Bears-R-Us:master May 18, 2020
Comment thread tests/base_test.py
nl = get_arkouda_numlocales()
(ArkoudaTest.server, ArkoudaTest.port, ArkoudaTest.ak_server) = start_arkouda_server(nl)
nl = int(get_arkouda_numlocales())
start_arkouda_server(numlocales=nl, host=ArkoudaTest.server, port=ArkoudaTest.port)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this breaks our nightly XC and CS testing. The original motivation for start_arkouda_server is to launch the server, and once the server is up and running have it report the hostname and port back via a file, since on clusters/supercomputers you don't know the host ahead of time. e.g. if I'm running on cori, you'll only know the server hostname once you've made it through the slurm queue and been given your nodes.

I think you could just stop passing the server to start_arkouda_server -- I'm not sure when you would need that in full stack mode.

@hokiegeek2 hokiegeek2 May 19, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ronawho oh wow, okay, I can take this out or set server to None. I put it in there because I am pretty sure that specifying the server was being added to Chapel and I wanted to enable configuration of the host (hostname or IP address) for situations where the are multiple NICs for the host.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ronawho okay, made it so the host can be none. Is passing in the ServerPort param okay:

`cmd = [get_arkouda_server(),
       '--logging={}'.format('true' if log else 'false'),
       '--v={}'.format('true' if verbose else 'false'),
       '--serverConnectionInfo={}'.format(connection_file),
       '-nl {}'.format(numlocales), '--ServerPort={}'.format(port)]`

Please confirm and I'll wrap up these updates and submit a pull request.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think I'm missing something -- looks like that's the same code that's on master

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ronawho yes, it was merged into the master yesterday.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh, sorry -- I misread, I thought you were asking me if this new code snippet looked ok, but you were just asking if the code on master that passes the port is ok.

Yeah, we don't do anything with the port, that change is good.

Comment thread tests/base_test.py
try:
nl = get_arkouda_numlocales()
(ArkoudaTest.server, ArkoudaTest.port, ArkoudaTest.ak_server) = start_arkouda_server(nl)
nl = int(get_arkouda_numlocales())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit but get_arkouda_numlocales() should already return an int

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will clean this up.

Comment thread tests/base_test.py
import subprocess, os, signal
from context import arkouda as ak
from util.test.util import start_arkouda_server, stop_arkouda_server, get_arkouda_numlocales
from util.test.util import get_arkouda_server, get_arkouda_numlocales,\

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused get_arkouda_server import

Comment thread pytest.ini
ARKOUDA_SERVER_HOST=localhost
ARKOUDA_SERVER_PORT=5555
ARKOUDA_FULL_STACK_TEST=True
ARKOUDA_NUMLOCALES=2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our nightly XC/CS testing we export ARKOUDA_NUMLOCALES=16 -- does the env var take priority, or does the value in the .ini file? (Based on a quick test it seems like the value in the ini file)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferring to you for pytest expertise, but maybe we can prefix these with D: to not override command line settings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ronawho You are correct and it sounds like it's dorking up your nightly test so I will take that out of pytest.ini.

@ronawho ronawho May 19, 2020 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine leaving it in if the .ini style is what python programmers will be used to. I think it'd just need to be D:ARKOUDA_NUMLOCALES=2 so that command line settings won't be overwritten

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ronawho gotcha, okay

Comment thread tests/base_test.py
(ArkoudaTest.server, ArkoudaTest.port, ArkoudaTest.ak_server) = start_arkouda_server(nl)
nl = int(get_arkouda_numlocales())
start_arkouda_server(numlocales=nl, host=ArkoudaTest.server, port=ArkoudaTest.port)
print('Started arkouda_server in full stack test mode')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're making changes, would you mind adding the number of locales to this print statement just so it's easy to see how many are being used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ronawho sure thing!

github-merge-queue Bot pushed a commit that referenced this pull request May 30, 2025
Fix a bug that prevents `tests/optioned-server/conftest.py` added in
#4391 from connecting to the server that's not on "localhost".

While there, clarify the handling of the server host and port in the
test suites:
* "Host" that comes from a command-line argument or environment variable
and defaults to `localhost` is used only in the CLIENT running mode.
* "Host" is obtained from `start_arkouda_server()`, which reads it from
`ak-server-info` that's created by the server, in GLOBAL_SERVER and
CLASS_SERVER modes.
* "Port" comes from a command-line argument or environment variable and
defaults to 5555; the port produced by `start_arkouda_server()` is
expected to be the same.

The testing frameworks store the host and the port for use in
`ak.connect()` as follows:

| suite | tests/ | benchmarks/ | benchmark_v2/ |
| :-- | :-- | :-- | :-- |
| host | `pytest.server` | `get_server_info()` | `pytest.host` |
| port | `pytest.port` | `get_server_info()` | `pytest.port` | 
| file | conftest.py | run_benchmarks.py | conftest.py |

The `host` argument of `start_arkouda_server()` has not been used for
its [intended
purpose](https://github.com/Bears-R-Us/arkouda/pull/374/files#r427210331)
since it was added in #374. I propose to remove it, which will increase
the clarity of code.

---------

Signed-off-by: Vassily Litvinov <[email protected]>
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.

3 participants