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-1017125: running pytest.main() programmatically hangs starting with snowflake-connector-python v3.4.1 #1860

Closed
mambon2 opened this issue Jan 23, 2024 · 5 comments
Assignees
Labels
bug status-information_needed Additional information is required from the reporter triaged

Comments

@mambon2
Copy link

mambon2 commented Jan 23, 2024

Python version

3.10.5

Operating system and processor architecture

ubuntu 22.04

Installed packages

Package                    Version
-------------------------- -----------
APScheduler                3.9.1
asn1crypto                 1.5.1
attrs                      21.4.0
boto3                      1.24.10
botocore                   1.27.10
certifi                    2022.6.15
cffi                       1.15.0
charset-normalizer         2.0.12
colorlog                   6.6.0
coverage                   7.1.0
cryptography               36.0.2
gevent                     21.12.0
greenlet                   1.1.2
humanize                   4.1.0
idna                       3.3
influxdb                   5.3.1
iniconfig                  1.1.1
Jinja2                     3.1.2
jmespath                   1.0.0
MarkupSafe                 2.1.1
mockito                    1.4.0
msgpack                    1.0.4
nest-asyncio               1.5.5
oscrypto                   1.3.0
packaging                  21.3
pip                        20.2.2
pluggy                     1.0.0
psycopg2-binary            2.9.3
py                         1.11.0
pycparser                  2.21
pycryptodomex              3.14.1
PyJWT                      2.4.0
PyMySQL                    1.0.2
pyOpenSSL                  22.0.0
pyparsing                  3.0.9
pytest                     7.1.2
pytest-cov                 4.0.0
python-dateutil            2.8.2
python-json-logger         2.0.2
pytz                       2022.1
pytz-deprecation-shim      0.1.0.post0
requests                   2.28.0
s3transfer                 0.6.0
setuptools                 49.6.0
six                        1.16.0
snowflake-connector-python 3.4.1
snowflake-sqlalchemy       1.3.4
SQLAlchemy                 1.4.37
tomli                      2.0.1
toposort                   1.9
tzdata                     2022.1
tzlocal                    4.2
ujson                      5.3.0
urllib3                    1.26.9
zope.event                 4.5.0
zope.interface             5.4.0

What did you do?

sys.exit(
        pytest.main(
            [
                "-ra",
                "--import-mode=append",
            ]
            + <some test using snowflake connector>
        )
    )

What did you expect to see?

expected pytest.main() to complete

Can you set logging to DEBUG and collect the logs?

import logging
import os

for logger_name in ('snowflake.connector',):
    logger = logging.getLogger(logger_name)
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    ch.setFormatter(logging.Formatter('%(asctime)s - %(threadName)s %(filename)s:%(lineno)d - %(funcName)s() - %(levelname)s - %(message)s'))
    logger.addHandler(ch)
@github-actions github-actions bot changed the title running pytest.main() programmatically hangs starting with snowflake-connector-python v3.4.1 SNOW-1017125: running pytest.main() programmatically hangs starting with snowflake-connector-python v3.4.1 Jan 23, 2024
@sfc-gh-jdu
Copy link
Collaborator

What's your auth method to snowflake? Is it possible that hanging is caused by asking for auth? Or could you provide more details about your test?

@mambon2
Copy link
Author

mambon2 commented Jan 26, 2024

What's your auth method to snowflake? Is it possible that hanging is caused by asking for auth? Or could you provide more details about your test?

authorization method is aws assumed-role
I forgot to mention that this actually works as expected with pytest console_script, meaning the CLI script. but it hangs when running programmatically through pytest.main(). Sounds like its not cleaning up resources after its done.

@mambon2
Copy link
Author

mambon2 commented Jan 26, 2024

works on v3.4.0
hangs on v3.4.1

@sfc-gh-aling
Copy link
Collaborator

is it possible to share your script with us or any workload would hang in this case?

@sfc-gh-dszmolka sfc-gh-dszmolka added the status-information_needed Additional information is required from the reporter label Mar 11, 2024
@sfc-gh-dszmolka
Copy link
Contributor

closing this issue for now as there been no response for a long time now, but if you still see this issue please let us know and we can work on it once the reproduction is made available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status-information_needed Additional information is required from the reporter triaged
Projects
None yet
Development

No branches or pull requests

4 participants