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 fail since May 3rd because of hardcoded date #127

Closed
mauritsvanrees opened this issue May 4, 2023 · 2 comments
Closed

Tests fail since May 3rd because of hardcoded date #127

mauritsvanrees opened this issue May 4, 2023 · 2 comments

Comments

@mauritsvanrees
Copy link
Sponsor Member

The Jenkins tests fail since May 3rd. Sample error:

datetime.datetime(2013, 5, 5, 10, 0, tzinfo=<DstTzInfo 'Europe/Vienna' CEST+2:00:00 DST>) not greater than datetime.datetime(2013, 5, 5, 8, 34, 48, tzinfo=tzutc())

  File "/srv/python3.11/lib/python3.11/unittest/case.py", line 57, in testPartExecutor
    yield
  File "/srv/python3.11/lib/python3.11/unittest/case.py", line 623, in run
    self._callTestMethod(testMethod)
  File "/srv/python3.11/lib/python3.11/unittest/case.py", line 579, in _callTestMethod
    if method() is not None:
       ^^^^^^^^
  File "/home/jenkins/workspace/plone-6.0-python-3.11/src/plone.app.caching/plone/app/caching/tests/test_profile_with_caching_proxy.py", line 136, in test_composite_viewsxx
    self.assertGreater(now, dateutil.parser.parse(browser.headers["Expires"]))

The datetime(2013, 5, 5) comes from the stable_now test method.

At first I suspected a Daylight Savings Time problem, but I think the tests always pass during the first four months of the year, and start failing around the beginning of May and will continue to fail the rest of the year. But in that case I don't see why this did not fail last year in December, so something else must have changed.

Also, I don't see why the Expires header has a date in 2013. Something in the tests will set this up, but I don't see it.

I will make a PR where I set the stable_now to June 5, so we have a month to fix this properly...

mauritsvanrees added a commit that referenced this issue May 4, 2023
… a testing error.

See #127.
Needs a proper fix within a month.
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue May 4, 2023
Branch: refs/heads/master
Date: 2023-05-04T17:33:08+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@2402a60

Changed hardcoded test date to June instead of May to temporarily fix a testing error.

See plone/plone.app.caching#127.
Needs a proper fix within a month.

Files changed:
A news/127.tests
M plone/app/caching/tests/test_utils.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-04T17:42:28+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@4dafd5d

Merge pull request #128 from plone/maurits-stable-now-moved-to-june-issue-127

Temporary fix: change test date to June instead of May

Files changed:
A news/127.tests
M plone/app/caching/tests/test_utils.py
@mauritsvanrees
Copy link
Sponsor Member Author

I merged my temporary solution so Jenkins is fixed for now: #128

As said, this needs a proper fix, otherwise we will have the same problem in June.

mauritsvanrees added a commit that referenced this issue May 8, 2023
… a testing error.

See #127.
Needs a proper fix within a month.

Backported from master: Plone 5.2 needs it as well.
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue May 8, 2023
Branch: refs/heads/2.x
Date: 2023-05-08T23:23:37+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@3b27a48

Changed hardcoded test date to June instead of May to temporarily fix a testing error.

See plone/plone.app.caching#127.
Needs a proper fix within a month.

Backported from master: Plone 5.2 needs it as well.

Files changed:
A news/127.tests
M plone/app/caching/tests/test_utils.py
Repository: plone.app.caching

Branch: refs/heads/2.x
Date: 2023-05-08T23:32:18+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@9914019

Merge pull request #129 from plone/plone/maurits-stable-now-moved-to-june-2x

Temporary fix: change test date to June instead of May [2.x]

Files changed:
A news/127.tests
M plone/app/caching/tests/test_utils.py
@mauritsvanrees
Copy link
Sponsor Member Author

I expect we will hit this problem again around tomorrow, June 3rd.

Ah, I found the problem!

Tests failed initially because we compare an Expires header with a stable date from May 2013. I did not understand how the Expires header itself could be from 2013: shouldn't this be 2023? We are not patching datetime.now anywhere. I changed the stable date to June 2013 to temporarily fix it.

But now I see why the Expires header comes from 2013. In several places in the code we call getExpiration(0). When you do this, you get an expiration date from ten years ago! And this expiration date is newer than the stable_now that we set.

I will fix test_utils.stable_now to use a relative date, so it will continue to work, also ten years in the future. I will do that as part of PR #130.

mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Jun 2, 2023
Branch: refs/heads/master
Date: 2023-05-30T14:56:20+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@c55c689

Remove old dependencies mappings from .meta.toml.

Files changed:
M .meta.toml
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-30T14:56:29+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@4364fb6

Configuring with plone/meta

Files changed:
A .github/workflows/meta.yml
A news/changelog_template.jinja
A news/fb4615d7.internal
M .meta.toml
M .pre-commit-config.yaml
M pyproject.toml
M setup.cfg
M tox.ini
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-30T14:57:03+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@ee29f9d

Removed docs/changelog_template.jinja.  This is in news/ now.

Files changed:
D docs/changelog_template.jinja
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-30T14:58:46+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@3579896

'discreet' is a default codespell ignore now.

Files changed:
M .meta.toml
M pyproject.toml
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-30T15:09:50+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@01b31f0

Fix extra check-manifest ignores.

Files changed:
M .meta.toml
M setup.cfg
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T11:29:16+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@c67548e

Fix purge test when restapi is not available.

With `plone.restapi` we have an extra `@comments` purge path.

Files changed:
M plone/app/caching/tests/test_purge.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T11:37:08+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@c34f42e

chore: plone.testing.z2 -&gt; zope

Files changed:
M plone/app/caching/tests/test_integration.py
M plone/app/caching/tests/test_operation_default.py
M plone/app/caching/tests/test_operation_parameters.py
M plone/app/caching/tests/test_profile_with_caching_proxy.py
M plone/app/caching/tests/test_profile_without_caching_proxy.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T11:47:15+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@fe92116

Removed 'xx' from end of test method.

Files changed:
M plone/app/caching/tests/test_profile_with_caching_proxy.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T12:07:20+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@53836bd

Fixed tests that compared a stable time with a ten year old Expires handler.

Fixes plone/plone.app.caching#127

Files changed:
A news/127.tests
M plone/app/caching/tests/test_utils.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T12:18:25+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@14e2d36

Configuring with plone/meta, remove setup.cfg

Files changed:
A .flake8
A news/e08b1234.internal
M .editorconfig
M .github/workflows/meta.yml
M .gitignore
M .meta.toml
M .pre-commit-config.yaml
M pyproject.toml
M tox.ini
D setup.cfg
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T21:02:28+02:00
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com>
Commit: plone/plone.app.caching@3401ed6

Merge pull request #130 from plone/config-with-default-template-33092427

Config with default template 33092427

Files changed:
A .flake8
A .github/workflows/meta.yml
A news/127.tests
A news/changelog_template.jinja
A news/e08b1234.internal
A news/fb4615d7.internal
M .editorconfig
M .gitignore
M .meta.toml
M .pre-commit-config.yaml
M plone/app/caching/tests/test_integration.py
M plone/app/caching/tests/test_operation_default.py
M plone/app/caching/tests/test_operation_parameters.py
M plone/app/caching/tests/test_profile_with_caching_proxy.py
M plone/app/caching/tests/test_profile_without_caching_proxy.py
M plone/app/caching/tests/test_purge.py
M plone/app/caching/tests/test_utils.py
M pyproject.toml
M tox.ini
D docs/changelog_template.jinja
D setup.cfg
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Jun 2, 2023
Branch: refs/heads/master
Date: 2023-05-30T14:56:20+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@c55c689

Remove old dependencies mappings from .meta.toml.

Files changed:
M .meta.toml
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-30T14:56:29+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@4364fb6

Configuring with plone/meta

Files changed:
A .github/workflows/meta.yml
A news/changelog_template.jinja
A news/fb4615d7.internal
M .meta.toml
M .pre-commit-config.yaml
M pyproject.toml
M setup.cfg
M tox.ini
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-30T14:57:03+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@ee29f9d

Removed docs/changelog_template.jinja.  This is in news/ now.

Files changed:
D docs/changelog_template.jinja
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-30T14:58:46+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@3579896

'discreet' is a default codespell ignore now.

Files changed:
M .meta.toml
M pyproject.toml
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-05-30T15:09:50+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@01b31f0

Fix extra check-manifest ignores.

Files changed:
M .meta.toml
M setup.cfg
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T11:29:16+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@c67548e

Fix purge test when restapi is not available.

With `plone.restapi` we have an extra `@comments` purge path.

Files changed:
M plone/app/caching/tests/test_purge.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T11:37:08+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@c34f42e

chore: plone.testing.z2 -&gt; zope

Files changed:
M plone/app/caching/tests/test_integration.py
M plone/app/caching/tests/test_operation_default.py
M plone/app/caching/tests/test_operation_parameters.py
M plone/app/caching/tests/test_profile_with_caching_proxy.py
M plone/app/caching/tests/test_profile_without_caching_proxy.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T11:47:15+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@fe92116

Removed 'xx' from end of test method.

Files changed:
M plone/app/caching/tests/test_profile_with_caching_proxy.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T12:07:20+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@53836bd

Fixed tests that compared a stable time with a ten year old Expires handler.

Fixes plone/plone.app.caching#127

Files changed:
A news/127.tests
M plone/app/caching/tests/test_utils.py
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T12:18:25+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@14e2d36

Configuring with plone/meta, remove setup.cfg

Files changed:
A .flake8
A news/e08b1234.internal
M .editorconfig
M .github/workflows/meta.yml
M .gitignore
M .meta.toml
M .pre-commit-config.yaml
M pyproject.toml
M tox.ini
D setup.cfg
Repository: plone.app.caching

Branch: refs/heads/master
Date: 2023-06-02T21:02:28+02:00
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com>
Commit: plone/plone.app.caching@3401ed6

Merge pull request #130 from plone/config-with-default-template-33092427

Config with default template 33092427

Files changed:
A .flake8
A .github/workflows/meta.yml
A news/127.tests
A news/changelog_template.jinja
A news/e08b1234.internal
A news/fb4615d7.internal
M .editorconfig
M .gitignore
M .meta.toml
M .pre-commit-config.yaml
M plone/app/caching/tests/test_integration.py
M plone/app/caching/tests/test_operation_default.py
M plone/app/caching/tests/test_operation_parameters.py
M plone/app/caching/tests/test_profile_with_caching_proxy.py
M plone/app/caching/tests/test_profile_without_caching_proxy.py
M plone/app/caching/tests/test_purge.py
M plone/app/caching/tests/test_utils.py
M pyproject.toml
M tox.ini
D docs/changelog_template.jinja
D setup.cfg
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Jul 13, 2023
Branch: refs/heads/2.x
Date: 2023-07-13T17:19:55+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@eb9afb8

chore: plone.testing.z2 -&gt; zope

Files changed:
M plone/app/caching/tests/test_integration.py
M plone/app/caching/tests/test_operation_default.py
M plone/app/caching/tests/test_operation_parameters.py
M plone/app/caching/tests/test_profile_with_caching_proxy.py
M plone/app/caching/tests/test_profile_without_caching_proxy.py
Repository: plone.app.caching

Branch: refs/heads/2.x
Date: 2023-07-13T17:20:02+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@4164ded

Removed 'xx' from end of test method.

Files changed:
M plone/app/caching/tests/test_profile_with_caching_proxy.py
Repository: plone.app.caching

Branch: refs/heads/2.x
Date: 2023-07-13T17:24:21+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@463c5a0

Fixed tests that compared a stable time with a ten year old Expires handler.

Fixes plone/plone.app.caching#127

Files changed:
A news/127.bugfix
M plone/app/caching/tests/test_utils.py
D news/127.tests
Repository: plone.app.caching

Branch: refs/heads/2.x
Date: 2023-07-13T18:13:28+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.caching@98ca498

Merge pull request #135 from plone/maurits-fix-test-plone-52

Fixed tests that compared a stable time with a ten year old Expires handler. [5.2]

Files changed:
A news/127.bugfix
M plone/app/caching/tests/test_integration.py
M plone/app/caching/tests/test_operation_default.py
M plone/app/caching/tests/test_operation_parameters.py
M plone/app/caching/tests/test_profile_with_caching_proxy.py
M plone/app/caching/tests/test_profile_without_caching_proxy.py
M plone/app/caching/tests/test_utils.py
D news/127.tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant