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

[AIRFLOW-5142] Fixed flaky cassandra test #5758

Merged
merged 1 commit into from
Aug 8, 2019

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Aug 8, 2019

Make sure you have checked all steps below.

Jira

Description

  • Here are some details about my PR, including screenshots of any UI changes:

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Commits

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
    • If you implement backwards incompatible changes, please leave a note in the Updating.md so we can assign it to a appropriate release

Code Quality

  • Passes flake8

@potiuk
Copy link
Member Author

potiuk commented Aug 8, 2019

@kaxil @BasPH -> we have a flaky cassandra test in master, so we'd better merge this fix quickly :)

@potiuk potiuk merged commit fc6967b into apache:master Aug 8, 2019
Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

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

I still don't exactly understand why was that flaky

@mik-laj
Copy link
Member

mik-laj commented Aug 8, 2019

The data structure that does not store the order of the elements. Sometimes last element has the value A and other times the value B.

@mik-laj
Copy link
Member

mik-laj commented Aug 8, 2019

@potiuk
Copy link
Member Author

potiuk commented Aug 8, 2019

Yeah. It's all explained in discussion here: #5753 and https://stackoverflow.com/a/39980744/1849502 - we have two method calls and they are sometimes in different order because of race and the test originally checked only last call (that's how assert_called_with works). It seems it was only problem in python 3.5 (not sure why it passed originally ) because there it's not the "last" call but the one which is determined by the dictionary order as pointed by @mik-laj . Now the test correctly tests if the two upload methods were called in any order.

@turbaszek
Copy link
Member

Interesting case! @potiuk is right, the test should assert two calls and I missed it in #5738 😔

@BasPH
Copy link
Contributor

BasPH commented Aug 8, 2019

@kaxil @BasPH -> we have a flaky cassandra test in master, so we'd better merge this fix quickly :)

I was too late, but nice work 😄

@kaxil
Copy link
Member

kaxil commented Aug 8, 2019

Thanks @potiuk & @mik-laj , I now understand that

ashb pushed a commit that referenced this pull request Oct 11, 2019
adityav pushed a commit to adityav/airflow that referenced this pull request Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants