Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Conversation

@kaxil
Copy link
Collaborator

@kaxil kaxil commented May 19, 2022

Uses https://docs.pytest.org/en/latest/how-to/usage.html#profiling-test-execution-duration to get a list of slowest 30 tests for which the durations is over 1.0s long.

This is a small change but will help identify if a test takes too long. Found a need to do that while working on #367 and #370

@kaxil kaxil marked this pull request as ready for review May 19, 2022 02:28
@tatiana
Copy link
Collaborator

tatiana commented May 19, 2022

@kaxil, that's very interesting. I didn't know about this feature!

Even though we're using "pytest>=6.0", which should support this feature, the CI didn't seem particularly happy with it; any thoughts about it? It may relate to how pytest parses the config on the pyproject.toml.

nox > pytest tests/test_example_dags.py -k sqlite --cov=src --cov-report=xml --cov-branch
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: argument --durations: invalid int value: '30 --durations-min=1.0' (via addopts config)

nox > Command pytest tests/test_example_dags.py -k sqlite --cov=src --cov-report=xml --cov-branch failed with exit code 4

@kaxil
Copy link
Collaborator Author

kaxil commented May 19, 2022

@tatiana fixed :) - the test failures are unrelated

@tatiana
Copy link
Collaborator

tatiana commented May 20, 2022

That's great, @kaxil , thank you! 🎉
What is causing the current tests to fail? It seems they are passing in main, it would be great to address the root cause of the issue before merging this PR.

@kaxil
Copy link
Collaborator Author

kaxil commented May 20, 2022

That's great, @kaxil , thank you! 🎉 What is causing the current tests to fail? It seems they are passing in main, it would be great to address the root cause of the issue before merging this PR.

It's the one I posted on Slack about:

E       sqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 090153 (22000): 01a46079-0604-a49f-0000-682108eb3a66: The result set size exceeded the max number of rows(10000) supported for SHOW statements. Use LIMIT option to limit result set to a smaller number.
E       [SQL: SHOW /* sqlalchemy:get_table_names */ TABLES IN astroflow_ci]
E       (Background on this error at: http://sqlalche.me/e/14/f405)

But I don't think we should hold this PR for that failure, it is completely unrelated, this PR does not impact the library just gives us the slowest test.

@kaxil kaxil merged commit c465879 into main May 20, 2022
@kaxil kaxil deleted the add-durations branch May 20, 2022 11:11
kaxil added a commit that referenced this pull request May 22, 2022
Uses https://docs.pytest.org/en/latest/how-to/usage.html#profiling-test-execution-duration to get a list of slowest 30 tests for which the durations is over 1.0s long.

This is a small change but will help identify if a test takes too long. Found a need to do that while working on #367 and #370
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants