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

Fix heisentest by ignoring the basepath #11993

Merged
merged 1 commit into from
Nov 2, 2020

Conversation

megaserg
Copy link
Contributor

@megaserg megaserg commented Oct 31, 2020

Problem:
The issue #10988 suspects that there's a dependency on side-effects from other tests.
However, the test itself seems pretty hermetic, creating a new randomly-named temp directory every time.
My guess is that there is a case where the randomly-generated name contains one of the ignored tokens.
For example, probability of a random 8-character name containing "not" is roughly 6 / 37^3 ~ 0.01%.
In this case, all files will be wrongfully ignored because we use the absolute path to perform the pattern matching.

Solution:
Use the relative path to perform the pattern matching. Also, look for the first match only (no need for re.findall()).

Validation:
The modified test intentionally includes ignored token "not" in the name of the base path. With this modification, the test fails 100% of the time, unless the suggested fix in find_path_from_directory() is applied.

Closes: #10988

@boring-cyborg
Copy link

boring-cyborg bot commented Oct 31, 2020

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, pylint and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@megaserg
Copy link
Contributor Author

@potiuk @j-y-matsubara does this hypothesis sound plausible to you?

@potiuk
Copy link
Member

potiuk commented Nov 2, 2020

Great findings! Indeed that looks like a plausible explanation AND it actually fixes a real problem that actual user might not have realized! Thanks @megaserg !

@potiuk potiuk merged commit 6447919 into apache:master Nov 2, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 2, 2020

Awesome work, congrats on your first merged pull request!

@github-actions
Copy link

github-actions bot commented Nov 2, 2020

The PR needs to run all tests because it modifies core of Airflow! Please rebase it to latest master or ask committer to re-run it!

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Nov 2, 2020
@potiuk
Copy link
Member

potiuk commented Nov 2, 2020

I disagree with you bot :)

potiuk added a commit to PolideaInternal/airflow that referenced this pull request Nov 2, 2020
This is a follow-up after apache#11993 - the behaviour of airflowignore
changes significantly enough to require a warning.
potiuk added a commit that referenced this pull request Nov 2, 2020
This is a follow-up after #11993 - the behaviour of airflowignore
changes significantly enough to require a warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:plugins full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Test_find_not_should_ignore_path is flaky
2 participants