Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1674875: merge gate for multithreaded wrapper tests #2336

Merged

Conversation

sfc-gh-aalam
Copy link
Contributor

@sfc-gh-aalam sfc-gh-aalam commented Sep 20, 2024

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1674875

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe.
  3. Please describe how your code solves the related issue.

    This PR adds:

    • multithreading_mode which runs tests marked with multithreaded_run concurrently in multiple threads using shared session.
    • merge gates to run snowpark and snowpandas tests in multithreaded mode
    • tags a subset of tests with multithreaded_run

Copy link

Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing

Copy link

Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing

def session():
with Session(MockServerConnection()) as s:
def mock_server_connection(multithreading_mode_enabled):
options = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

local testing does not make real connection so testing enabled/disabled mode using parameter.

Base automatically changed from SNOW-1720835-param-protect-client-side-changes to main October 17, 2024 19:57
Copy link

Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing

@sfc-gh-aalam sfc-gh-aalam added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Oct 17, 2024
Copy link

Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing

@sfc-gh-aalam sfc-gh-aalam enabled auto-merge (squash) October 17, 2024 22:58
@@ -79,8 +79,12 @@ def auto_annotate_sql_counter(request):

@pytest.fixture(autouse=True)
def check_sql_counter_invoked(request):
from tests.conftest import SKIP_SQL_COUNT_CHECK

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, right now yes. but we do not only develop for what will happen at this moment. it seems that with you change here, we need to propagate up this function to make sure the sql counter check can be adopted in general in snowpark python.
We don't have to do this in the current pr, but could you have a follow up pr to move that up to snowpark python for general usage


@pytest.fixture(scope="session", autouse=True)
def multithreading_mode(pytestconfig):
enabled = pytestconfig.getoption("multithreading_mode")
Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry, what do you mean here? it seems this flag can only be turned on when the thread-safe session configuration can be turned on

@pytest.mark.multithreaded_run
@functools.wraps(func)
def wrapper(*args, **kwargs):
if MULTITHREADING_TEST_MODE_ENABLED:
Copy link
Collaborator

Choose a reason for hiding this comment

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

for those tests, probably doesn't work when the thread safe session object is not enabled, you might have to add a check here once you have the feature flag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I seem to have removed config which creates session in thread-safe mode with --multithreading_mode option. I have readded it now.

Copy link

Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing

@sfc-gh-aalam sfc-gh-aalam merged commit d2f0cd1 into main Oct 18, 2024
37 of 38 checks passed
@sfc-gh-aalam sfc-gh-aalam deleted the aalam-SNOW-1674875-merge-gate-for-multithreaded-wrapper-tests branch October 18, 2024 22:25
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
local testing Local Testing issues/PRs NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md snowpark-pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants