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

Rerun flaky PinotDB integration test #28562

Merged
merged 1 commit into from
Dec 27, 2022

Conversation

Taragolis
Copy link
Contributor

Time to time we have this error on public runner.

self = <tests.integration.providers.apache.pinot.hooks.test_pinot.TestPinotDbApiHookIntegration object at 0x7f36f132d450>

    @mock.patch.dict("os.environ", AIRFLOW_CONN_PINOT_BROKER_DEFAULT="pinot://pinot:8000/")
    def test_should_return_records(self):
        hook = PinotDbApiHook()
        sql = "select playerName from baseballStats  ORDER BY playerName limit 5"
        records = hook.get_records(sql)
>       assert [["A. Harry"], ["A. Harry"], ["Aaron"], ["Aaron Albert"], ["Aaron Albert"]] == records
E       AssertionError: assert [['A. Harry']...aron Albert']] == []
E         Left contains 5 more items, first extra item: ['A. Harry']
E         Use -v to get the full diff

tests/integration/providers/apache/pinot/hooks/test_pinot.py:34: AssertionError

Most probably the nature of this error some kind of race condition:

  1. PinotDB test service marked healthy before data actually persist into test database
  2. Test get 0 record as result test failed.

In case of failure test will rerun after 30 seconds but only once.

In additional I remove flaky as dev-dependency because it use the same marker @pytest.mark.flaky as pytest-rerunfailures plugin.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

Yes. The problem here is that starting quickstart merely starts the injestion job for baseball stats and does not wait for completion. I considered changing health-check but that would be quite complex and re-running failed test in this case is much simpler solution

@potiuk potiuk merged commit fff9fd3 into apache:main Dec 27, 2022
@pierrejeambrun pierrejeambrun added the type:misc/internal Changelog: Misc changes that should appear in change log label Jan 9, 2023
@pierrejeambrun pierrejeambrun added this to the Airflow 2.5.1 milestone Jan 9, 2023
@Taragolis Taragolis deleted the rerun-flaky-pinotdb-integration-test branch January 14, 2023 18:25
ephraimbuddy pushed a commit that referenced this pull request Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants