Skip to content

Conversation

@labkey-tchad
Copy link
Member

Rationale

The error message for DbScope.TransactionTestCase.testServerRowLock isn't as informative as it could be. If we throw the unexpected exception instead of just logging the message, it will help diagnose what went wrong.

  java.lang.AssertionError: Unexpected exceptions: null
java.lang.IllegalStateException: Caller is already loading this object!
  at org.junit.Assert.fail(Assert.java:89)
  at org.junit.Assert.assertTrue(Assert.java:42)
  at org.labkey.api.data.DbScope$TransactionTestCase.testServerRowLock(DbScope.java:3399)

Related Pull Requests

  • N/A

Changes

  • Improve failure logging from DbScope.TransactionTestCase

Copy link
Contributor

@labkey-jeckels labkey-jeckels left a comment

Choose a reason for hiding this comment

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

Failure mode looks more helpful. One request before merging though.

return result;

assertFalse("No exceptions from attempted deadlock.", result.isEmpty());
result.stream().filter(t -> !expectedException.isAssignableFrom(t.getClass()))
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment on the intent here would be helpful - I believe it's choosing between reusing an existing exception in the list or throwing a new one?

@labkey-jeckels
Copy link
Contributor

@labkey-tchad I pushed a change to this FB to make it a best-effort attempt to log the lock and activity data. See what you think before merging.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants