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

Test Failure with "make integration-fail-fast" command #3297

Closed
1 of 5 tasks
peiwangdb opened this issue Apr 26, 2021 · 2 comments · Fixed by #3344
Closed
1 of 5 tasks

Test Failure with "make integration-fail-fast" command #3297

peiwangdb opened this issue Apr 26, 2021 · 2 comments · Fixed by #3344
Labels
bug Something isn't working

Comments

@peiwangdb
Copy link
Contributor

Describe the bug

A clear and concise description of what the bug is. What command did you run? What happened?
I ran "make integration-fail-fast" command, it fails with

test/integration/004_simple_snapshot_test/test_simple_snapshot.py:862: in _snapshot_and_assert_invalidated
    self.assertGreaterEqual(result[-1].replace(tzinfo=pytz.UTC), self._invalidated_snapshot_datetime)
AssertionError: datetime.datetime(2021, 4, 26, 9, 7, 58, 180921, tzinfo=<UTC>) not greater than or equal to datetime.datetime(2021, 4, 26, 16, 7, 56, 828247, tzinfo=<UTC>)

Steps To Reproduce

run the command in the PST timezone.

Expected behavior

I don't understand why this fails.

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:
pulled from develop branch.

The operating system you're using:
MAC OS darwin

The output of python --version:
Python 3.8.8

Additional context

Add any other context about the problem here.

@peiwangdb peiwangdb added bug Something isn't working triage labels Apr 26, 2021
@jtcohen6
Copy link
Contributor

@peiwangdb Thanks for raising this! I saw this happen intermittently before, but I wasn't sure of the cause. You gave the perfect clue:

run the command in the PST timezone.

I switched my computer to PST, and was able to reproduce this with ease. Nice!

I think the fix here is just a matter of switching .replace(tzinfo=pytz.UTC) with .astimezone(pytz.UTC) in the following spots. I switched those and was able to get this test passing locally, in PST + EST.
https://github.com/fishtown-analytics/dbt/blob/39f350fe89bd11215208be2513bb97020287a636/test/integration/004_simple_snapshot_test/test_simple_snapshot.py#L862
https://github.com/fishtown-analytics/dbt/blob/39f350fe89bd11215208be2513bb97020287a636/test/integration/004_simple_snapshot_test/test_simple_snapshot.py#L902
https://github.com/fishtown-analytics/dbt/blob/39f350fe89bd11215208be2513bb97020287a636/test/integration/004_simple_snapshot_test/test_simple_snapshot.py#L924

Is that a fix you'd be interesting in contributing? :)

@jtcohen6 jtcohen6 removed the triage label Apr 27, 2021
@peiwangdb
Copy link
Contributor Author

@jtcohen6 thanks a lot for the detailed guidance! I definitely would like to fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants