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

[16.0][FIX] cron_daylight_saving_time_resistant: Keep test savepoint #2899

Conversation

SirAionTech
Copy link
Contributor

Fix the following:

This module seems to be causing test failures in recent PRs:

 2024-03-22 11:59:44,139 390 ERROR odoo odoo.addons.cron_daylight_saving_time_resistant.tests.test_dst: ERROR: TestDST.test_cron
Traceback (most recent call last):
  File "/opt/odoo/odoo/sql_db.py", line 176, in __exit__
    self.commit()
  File "/opt/odoo/odoo/sql_db.py", line 558, in commit
    self._savepoint.close(rollback=False)
  File "/opt/odoo/odoo/sql_db.py", line 86, in close
    self._close(rollback)
  File "/opt/odoo/odoo/sql_db.py", line 94, in _close
    self._cr.execute(SQL('RELEASE SAVEPOINT {}').format(self._name))
  File "/opt/odoo/odoo/sql_db.py", line 321, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.InvalidSavepointSpecification: savepoint "13b0b903-3992-11ec-965e-5f38e53695a9" does not exist


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/__w/server-tools/server-tools/cron_daylight_saving_time_resistant/tests/test_dst.py", line 71, in test_cron
    self._check_cron_date_after_run(cron, "2021-10-30 15:00:00")
  File "/__w/server-tools/server-tools/cron_daylight_saving_time_resistant/tests/test_dst.py", line 43, in _check_cron_date_after_run
    registry["ir.cron"]._process_job(db, new_cr, job)
  File "/__w/server-tools/server-tools/cron_daylight_saving_time_resistant/models/ir_cron.py", line 48, in _process_job
    with cls.pool.cursor() as job_cr:
  File "/opt/odoo/odoo/sql_db.py", line 178, in __exit__
    self.close()
  File "/opt/odoo/odoo/sql_db.py", line 540, in close
    self.rollback()
  File "/opt/odoo/odoo/sql_db.py", line 571, in rollback
    self._savepoint.rollback()
  File "/opt/odoo/odoo/sql_db.py", line 89, in rollback
    self._cr.execute(SQL('ROLLBACK TO SAVEPOINT {}').format(self._name))
  File "/opt/odoo/odoo/sql_db.py", line 321, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.InvalidSavepointSpecification: savepoint "13b0b903-3992-11ec-965e-5f38e53695a9" does not exist

https://github.com/OCA/server-tools/actions/runs/8389895772/job/22977050191?pr=2887

Would you be so kind as to have a look?

Originally posted by @StefanRijnhart in #2578 (comment)

This is causing tests failure for every 16.0-based PR.

@OCA-git-bot
Copy link
Contributor

Hi @florian-dacosta,
some modules you are maintaining are being modified, check this out!

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the branch green again!

@StefanRijnhart StefanRijnhart added this to the 16.0 milestone Apr 5, 2024
@StefanRijnhart StefanRijnhart changed the title [FIX] cron_daylight_saving_time_resistant: Keep test savepoint [16.0][FIX] cron_daylight_saving_time_resistant: Keep test savepoint Apr 5, 2024
@StefanRijnhart
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-2899-by-StefanRijnhart-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit a3c4fc0 into OCA:16.0 Apr 5, 2024
8 of 9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at d416428. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants