aws / efs-utils

Utilities for Amazon Elastic File System (EFS)
MIT License
285 stars 187 forks source link

Failing test: test_version_check_ready #194

Closed major closed 6 months ago

major commented 7 months ago

Testing with Python 3.12 on Fedora Rawhide (soon to be Fedora 40):

=================================== FAILURES ===================================
___________________________ test_version_check_ready ___________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffaca202210>

    def test_version_check_ready(mocker):
        old_datetime = datetime(2000, 2, 3, 5, 35, 2)
        mocker.patch(
            "watchdog.EFSUtilsVersionChecker.get_last_version_check_time",
            return_value=old_datetime,
        )
>       assert watchdog.EFSUtilsVersionChecker.version_check_ready()

test/watchdog_test/test_check_if_using_old_version.py:133: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @staticmethod
    def version_check_ready():
        """Inspect the last version check file and return true if the time since last version check
        is greater than VERSION_CHECK_POLL_INTERVAL"""
        last_version_check_time = EFSUtilsVersionChecker.get_last_version_check_time()
        if not last_version_check_time:
            return True

>       elapsed_seconds = (get_utc_now() - last_version_check_time).total_seconds()
E       TypeError: can't subtract offset-naive and offset-aware datetimes

src/watchdog/__init__.py:360: TypeError
RyanStan commented 7 months ago

Thanks for pointing this out. This will be addressed in v1.35.2. We'll need to update our test infra to run against Python 3.12.

RyanStan commented 6 months ago

Closing the issue since v1.35.2 reverted the version checker.