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

3.0.4: ORA-00001: unique constraint (UT3.UT_ANNOTATION_CACHE_PK) violated #516

Closed
tkleiber opened this Issue Nov 17, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@tkleiber
Copy link

tkleiber commented Nov 17, 2017

We run on Oracle EE 11.2.0.4 and get this error:

Error report -
ORA-00001: unique constraint (UT3.UT_ANNOTATION_CACHE_PK) violated
ORA-06512: at "UT3.UT_RUNNER", line 101
ORA-06512: at "UT3.UT", line 105
ORA-06512: at "UT3.UT", line 270
ORA-06512: at "UT3.UT", line 322
ORA-06512: at line 2

  1. 00000 - "unique constraint (%s.%s) violated"
    *Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
    For Trusted Oracle configured in DBMS MAC mode, you may see
    this message if a duplicate entry exists at a different level.
    *Action: Either remove the unique restriction or do not insert the key.

Downgrading to 3.0.3 fix the problem.

@jgebal

This comment has been minimized.

Copy link
Member

jgebal commented Nov 17, 2017

I think I've encountered this issue before.
It will be fixed with refactoring on annotation parser.
I believe one of your suites has something like this:

package test_package is
  --%suite(first annotation)
  --%test(second annotation)
  procedure test_procedure_1;
  --%test(third annotation)
  procedure test_procedure_2;
end;

The annotations on top are allocated to both suite as well as first test.
So you end up with annotations:
suite level has:

  • first annotation
  • second annotation

test procedure 1 has:

  • first annotation
  • second annotation

test procedure 2 has:

  • third annotation

To avoid this issue in 3.0.4 make sure you separate suite-level annotations from test level annotations.

In next versions this behaviour will change so that the above case will cause no suite level annotations to be created.
This means that your suite will no longer be valid in that case.

A valid test package would be:

package test_package is
  --%suite(first annotation)

  --%test(second annotation)
  procedure test_procedure_1;
  --%test(third annotation)
  procedure test_procedure_2;
end;

Notice:
The empty line is used to separate annotations associated with package from annotations associated with procedure.

@jgebal jgebal added this to the v3.0.5 milestone Nov 17, 2017

@jgebal jgebal added the bug label Nov 17, 2017

@tkleiber

This comment has been minimized.

Copy link
Author

tkleiber commented Nov 17, 2017

Yes, this was the problem. Have double checked this with the formatters in our IDE's, which let the empty line in the code now. But will be good the fix this in the future.
Thanks!

@jgebal

This comment has been minimized.

Copy link
Member

jgebal commented Nov 17, 2017

@tkleiber Can you join the Slack and share your experiences with utPLSQL v3 so far?

@tkleiber

This comment has been minimized.

Copy link
Author

tkleiber commented Nov 17, 2017

Will give a presentation next week at DOAG2017, why we decide us for utPLSQL v3.

jgebal added a commit that referenced this issue Nov 26, 2017

Improvements and refactoring of `ut_annotation_parser`
- Partly resolves #516 - ORA-00001: unique constraint (UT3.UT_ANNOTATION_CACHE_PK) violated. The exception will not occur anymore, but such suite will not be executed.
- Allows for "floating" annotations

@jgebal jgebal self-assigned this Nov 26, 2017

@jgebal jgebal added the in progress label Nov 26, 2017

@jgebal jgebal closed this in #522 Nov 27, 2017

@jgebal jgebal removed the in progress label Nov 27, 2017

@jgebal jgebal modified the milestones: v3.0.5, v3.1.0 Feb 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.