Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • openbravo openbravo
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 36
    • Merge requests 36
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • openbravo
  • product
  • openbravoopenbravo
  • Merge requests
  • !354

fixes BUG-46159: unstable DalLockingTest.lockedObjectShouldAllowChildrenCreation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Asier Lostalé requested to merge alo-issues/openbravo:fix/46159-DalLockingTest into master Apr 29, 2021
  • Overview 2
  • Commits 1
  • Changes 1

This tests executes 2 threads:

  • T1: acquires a lock on an AlertRule and keeps running for a while (200ms)
  • T2: is executed after the lock is aquiered and inserts a recipient for the rule with the lock

The tests asserts T2 completes before than T1, ensuring in PG the lock is a FOR UPDATE NO KEY which allows insertions in child tables even there is a lock in the parent. It assumes T2 completes faster than the 200ms T1 waits after the lock is acquired.

In certain cases, it is possible T2 to take more than 200ms to do complete the instertion. In these cases T1 will finish before T2 making the test fail.

This commit fixes the problem by removing the fixed 200ms wait in T1 replacing it with a latch to wait for T2 to complete (or fail if it takes more than 10s, which never should be the case).

On top:

  • It adds some timing information to the logs
  • fixes a typo in waitUntil method name

Try run

  • https://builds.openbravo.com/view/try/job/try-init/773/console
Edited Apr 29, 2021 by Asier Lostalé
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix/46159-DalLockingTest