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

Warn if collection spends >5s traversing a directory without collecting any tests #12312

Open
Zac-HD opened this issue May 12, 2024 · 1 comment
Labels
topic: collection related to the collection phase topic: reporting related to terminal output and user-facing messages and errors type: performance performance or memory problem/improvement

Comments

@Zac-HD
Copy link
Member

Zac-HD commented May 12, 2024

I recently saw #5851 (comment), which made me wonder if we could automatically detect similar cases and suggest using the --ignore flag or norecursedirs config option.

Tracking the time spent in collection on a per-directory basis and whether any test files were collected should be pretty straightforward, and from there it's just the reporting code. Specifically: depth-first search over the tree, don't recurse into children if the current node triggered the warning or took <= 5s. Alternatively, maybe this could be integrated with the collection code so that we don't need a separate step.

@Zac-HD Zac-HD added topic: reporting related to terminal output and user-facing messages and errors topic: collection related to the collection phase type: performance performance or memory problem/improvement labels May 12, 2024
@Pierre-Sassoulas
Copy link
Contributor

Kinda related, but maybe when the --durations option is used, we also display the collection time per directory ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: collection related to the collection phase topic: reporting related to terminal output and user-facing messages and errors type: performance performance or memory problem/improvement
Projects
None yet
Development

No branches or pull requests

2 participants