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_long_event fails early on the first of the month #334

Closed
mauritsvanrees opened this issue Jul 1, 2021 · 1 comment · Fixed by #383
Closed

test_long_event fails early on the first of the month #334

mauritsvanrees opened this issue Jul 1, 2021 · 1 comment · Fixed by #383

Comments

@mauritsvanrees
Copy link
Sponsor Member

One test failed on Jenkins 5.2 Py 3.6, 3.7 and 3.8, but not on 2.7.
See Jenkins.
Error was:

0 != 3

  File "/srv/python3.8/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/srv/python3.8/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/srv/python3.8/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/home/jenkins/workspace/plone-5.2-python-3.8/src/plone.app.event/plone/app/event/tests/test_portlet_calendar.py", line 194, in test_long_event
    self.assertEqual(rd.count('e1'), 3)
  File "/srv/python3.8/lib/python3.8/unittest/case.py", line 912, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/srv/python3.8/lib/python3.8/unittest/case.py", line 905, in _baseAssertEqual
    raise self.failureException(msg)

I ran the builds again half a day later, and all succeeded.

The main page of the build says: "Build #1156 (01-Jul-2021 00:07:07)". I think the date and time are important. I guess this is the start date, but might also be the end date.

So the three Python 3 jobs failed, but the 2.7 job passed. This could be a timing issue: the 2.7 job started at 0:18, which is 10 to 15 minutes after the Py 3 jobs.

I expect that this is a small problem in the tests, but it could also be a real problem.
I have not dived in.

This is the test code, in case someone wants to have a look. Maybe it is as simple as creating an event not starting on the first day of the current month, but say the fifth day of the next month.

@mauritsvanrees
Copy link
Sponsor Member Author

This happened today again for the Plone 6.0 and 6.1 jobs. I am preparing a fix (I hope).

@mauritsvanrees mauritsvanrees self-assigned this Sep 1, 2023
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Oct 5, 2023
Branch: refs/heads/master
Date: 2023-09-01T18:50:34+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.event@ac473af

Fix test_long_event when run around midnight of the first day of the month.

Fixes plone/plone.app.event#334.

Files changed:
A news/334.tests
M plone/app/event/tests/test_portlet_calendar.py
Repository: plone.app.event

Branch: refs/heads/master
Date: 2023-10-05T11:21:59+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.event@9ff0aa9

Merge branch 'master' into maurits-test-long-event-master

Files changed:
A news/172.internal
M .pre-commit-config.yaml
M pyproject.toml
M tox.ini
Repository: plone.app.event

Branch: refs/heads/master
Date: 2023-10-05T16:10:25+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.event@71757d6

Merge pull request #383 from plone/maurits-test-long-event-master

Fix test_long_event when run around midnight of first day of month

Files changed:
A news/334.tests
M plone/app/event/tests/test_portlet_calendar.py
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Oct 5, 2023
Branch: refs/heads/master
Date: 2023-09-01T18:50:34+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.event@ac473af

Fix test_long_event when run around midnight of the first day of the month.

Fixes plone/plone.app.event#334.

Files changed:
A news/334.tests
M plone/app/event/tests/test_portlet_calendar.py
Repository: plone.app.event

Branch: refs/heads/master
Date: 2023-10-05T11:21:59+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.event@9ff0aa9

Merge branch 'master' into maurits-test-long-event-master

Files changed:
A news/172.internal
M .pre-commit-config.yaml
M pyproject.toml
M tox.ini
Repository: plone.app.event

Branch: refs/heads/master
Date: 2023-10-05T16:10:25+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.app.event@71757d6

Merge pull request #383 from plone/maurits-test-long-event-master

Fix test_long_event when run around midnight of first day of month

Files changed:
A news/334.tests
M plone/app/event/tests/test_portlet_calendar.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant