Perl live test fail on main today - 32-lp1207533-triggered-events.t

Bug #2065540 reported by Blake GH
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned

Bug Description

Preparing for 3.13 release, we're finding a test failing on standard a concerto database. The issue stems from a hard coded ID number in the 950 seed data when inserting a AT definition:

INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, group_field, usr_field, template)
    VALUES (120, 'f', 1, 'Vandelay Background Import Requested', 'vandelay.background_import.requested', 'NOOP_True', 'SendEmail', 'email', 'owner',
$$
....

as well as the next INSERT:

INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, group_field, usr_field, template)
    VALUES (121, 'f', 1, 'Vandelay Background Import Completed', 'vandelay.background_import.completed', 'NOOP_True', 'SendEmail', 'email', 'owner',
$$
.....

The other action_trigger.event_definition insert statements in the 950 don't hard code an ID number. Hard coding the ID number means the DB sequence doesn't get used. Without incrementing the sequence, future inserts into that table will run into a conflict with the next ID in the sequence.

This test:

32-lp1207533-triggered-events.t

Throws this:

not ok 2 - Successfully created atevdef

Because the previous AT event def wasn't successfully inserted. Here's what postgres has to say about it:

2024-05-12 17:23:17.604 EDT [28171] evergreen@evergreen ERROR: duplicate key value violates unique constraint "event_definition_pkey"
2024-05-12 17:23:17.604 EDT [28171] evergreen@evergreen DETAIL: Key (id)=(120) already exists.
2024-05-12 17:23:17.604 EDT [28171] evergreen@evergreen STATEMENT: INSERT INTO action_trigger.event_definition (id,active,owner,hook,validator,reactor,cleanup_success,cleanup_failure,delay,max_delay,delay_field,group_field,template,name,granularity,usr_field,opt_in_setting,repeat_delay,message_template,message_title,message_usr_path,message_library_path,retention_interval,context_usr_path,context_library_path,context_bib_path,context_item_path) VALUES (DEFAULT,'1',1,'checkout','NOOP_True','NOOP_True',DEFAULT,DEFAULT,'0',DEFAULT,'xact_start','usr',DEFAULT,'circ event test',DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,'usr','circ_lib','target_copy.call_number.record',DEFAULT);
2024-05-12 17:23:17.604 EDT [28171] evergreen@evergreen ERROR: current transaction is aborted, commands ignored until end of transaction block

Branch forthcoming

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Blake GH (bmagic) wrote :

This fixes it for me:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/blake/lp2065540_perl_live_fix

Plus: I think this would have caused our resulting SQL version-upgrade script from running properly on an already-established Evergreen system.

Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbergja)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Blake! And thanks, test, for pointing out this issue. Pushed to main.

tags: added: pullrequest signedoff
Changed in evergreen:
milestone: none → 3.13-beta
importance: Undecided → High
status: Confirmed → Fix Committed
Revision history for this message
Jane Sandberg (sandbergja) wrote :

I marked it as High since it would cause upgrades to fail, and since it would prevent new installations from adding event definitions.

Changed in evergreen:
assignee: Jane Sandberg (sandbergja) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.