Skip to content

Conversation

@keyurusdadiya
Copy link
Contributor

Closes #58470
Fix tests broken by time-machine 3.0+ upgrade

The new time-machine 3.0 removed automatic mocking of time.monotonic() and time.monotonic_ns.
Also the dateutil support is optional , one can use it as time-machine[dateutil] , we need dateutil as used in

Refer below change log of time-machine from 3.0.0 and beyond:
https://time-machine.readthedocs.io/en/latest/changelog.html

Changes

  • time-machine[dateutil] to >=3.0.0
  • Mocked time.monotonic with unittest.mock.patch where needed as the support is deprecated from 3.0.0 and beyond.
    monotonic time kept ticking after the time was freezed with time-machine.
  • changed time_machine.coordinates.shift() to time_machine.shift()

Fix time-machine lib >=3.0.0 supporting changes
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 22, 2026

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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks 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.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk potiuk merged commit 2b88c12 into apache:main Jan 23, 2026
129 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 23, 2026

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@bugraoz93
Copy link
Contributor

Nice! Thanks! Congrats on your first PR!

suii2210 pushed a commit to suii2210/airflow that referenced this pull request Jan 26, 2026
Fix time-machine lib >=3.0.0 supporting changes
shreyas-dev pushed a commit to shreyas-dev/airflow that referenced this pull request Jan 29, 2026
Fix time-machine lib >=3.0.0 supporting changes
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
Fix time-machine lib >=3.0.0 supporting changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update time-machine to 3.0.0

3 participants