Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10831 closed (fixed)

Using autocommit transaction decorator with new-style TestCase can lead to incorrect DB commit

Reported by: seanl Owned by: kmtracey
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The autocommit transaction decorator calls transaction.managed(False) which can under some circumstances cause a DB commit. Thus the managed function should be nop'd like the other transaction functions (see attached patch) to avoid unwanted commits whilst running new-style TestCase tests.

Attachments (1)

10831-test-case-nops-out-transaction-managed-func.diff (1.1 KB) - added by seanl 5 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 5 years ago by kmtracey

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to kmtracey
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by kmtracey

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [10621]) Fixed #10831 -- Prevented code running under a to-be-rolled-back test from calling commit via transaction.managed(False). Thanks seanl for report and patch.

comment:3 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.