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

Tests for next_occurrence break at certain times of day #1895

Closed
5 tasks done
jemrobinson opened this issue May 17, 2024 · 0 comments · Fixed by #1893
Closed
5 tasks done

Tests for next_occurrence break at certain times of day #1895

jemrobinson opened this issue May 17, 2024 · 0 comments · Fixed by #1893
Labels
bug Problem when deploying a Data Safe Haven.

Comments

@jemrobinson
Copy link
Member

jemrobinson commented May 17, 2024

✅ Checklist

  • I have searched open and closed issues for duplicates.
  • This is a problem observed when deploying a Data Safe Haven.
  • I can reproduce this with the latest version.
  • I have read through the documentation.
  • This isn't an open-ended question (open a discussion if it is).

💻 System information

  • Operating System: macOS
  • Data Safe Haven version: develop @ 9e5b72a

📦 Packages

List of packages
acme==2.6.0
annotated-types==0.6.0
appdirs==1.4.4
Arpeggio==2.0.2
attrs==23.2.0
azure-common==1.1.28
azure-core==1.30.1
azure-identity==1.16.0
azure-keyvault-certificates==4.8.0
azure-keyvault-keys==4.9.0
azure-keyvault-secrets==4.8.0
azure-mgmt-automation==1.0.0
azure-mgmt-compute==30.6.0
azure-mgmt-containerinstance==10.1.0
azure-mgmt-core==1.4.0
azure-mgmt-dns==8.1.0
azure-mgmt-keyvault==10.3.0
azure-mgmt-msi==7.0.0
azure-mgmt-network==25.3.0
azure-mgmt-rdbms==10.1.0
azure-mgmt-resource==23.0.1
azure-mgmt-storage==21.1.0
azure-storage-blob==12.19.1
azure-storage-file-datalake==12.14.0
azure-storage-file-share==12.15.0
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
chevron==0.14.0
click==8.1.7
cryptography==42.0.6
-e git+ssh://git@github.com/jemrobinson/data-safe-haven.git@cb3d09511884bff82ab33b39e18b1db74dad7959#egg=data_safe_haven
dill==0.3.8
dnspython==2.4.2
fqdn==1.5.1
grpcio==1.60.1
idna==3.7
iniconfig==2.0.0
isodate==0.6.1
josepy==1.14.0
markdown-it-py==3.0.0
mdurl==0.1.2
msal==1.28.0
msal-extensions==1.1.0
msrest==0.7.1
oauthlib==3.2.2
packaging==24.0
parver==0.5
pluggy==1.5.0
portalocker==2.8.2
protobuf==4.25.3
psycopg==3.1.18
pulumi==3.115.0
pulumi_azure_native==2.39.0
pulumi_random==4.16.1
pycparser==2.22
pydantic==2.7.1
pydantic_core==2.18.2
Pygments==2.18.0
PyJWT==2.8.0
pyOpenSSL==24.1.0
pyRFC3339==1.1
pytest==8.2.0
pytest-asyncio==0.23.6
pytz==2023.4
PyYAML==6.0.1
requests==2.31.0
requests-oauthlib==2.0.0
rich==13.7.1
semver==2.13.0
setuptools==69.5.1
shellingham==1.5.4
simple-acme-dns==3.0.0
six==1.16.0
typer==0.12.3
typing_extensions==4.11.0
urllib3==2.2.1
validators==0.22.0
websocket-client==1.8.0

🚫 Describe the problem

At certain times of day next_occurrence can choose a datetime more than 1 day in the future, causing the tests to break.

🌳 Log messages

Relevant log messages
___________________ test_next_occurrence_is_within_next_day ____________________

    def test_next_occurrence_is_within_next_day():
        next_time = next_occurrence(5, 13, "Australia/Perth")
        dt_next_time = datetime.datetime.fromisoformat(next_time)
        dt_utc_now = datetime.datetime.now(datetime.UTC)
        assert dt_next_time > dt_utc_now
>       assert dt_next_time < dt_utc_now + datetime.timedelta(days=1)
E       AssertionError: assert datetime.datetime(2024, 5, 17, 21, 13, tzinfo=datetime.timezone.utc) < (datetime.datetime(2024, 5, 16, 16, 52, 28, 540053, tzinfo=datetime.timezone.utc) + datetime.timedelta(days=1))
E        +  where datetime.timedelta(days=1) = <class 'datetime.timedelta'>(days=1)
E        +    where <class 'datetime.timedelta'> = datetime.timedelta

tests/functions/test_strings.py:16: AssertionError

♻️ To reproduce

Run hatch run test:test at around 16:15 UTC.

@jemrobinson jemrobinson added the bug Problem when deploying a Data Safe Haven. label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problem when deploying a Data Safe Haven.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant