OpenJPA
  1. OpenJPA
  2. OPENJPA-1753

TestMixedLockManagerLockPermutation: Timing issue determines the pass/no-pass of the test case

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.0.1, 2.1.0
    • Component/s: None
    • Labels:
      None

      Description

      This test case spawns three threads and the pass/no pass of the test cases depends on the timing.

      One example is TestMixedLockManagerFindPermutation.testFindReadPessimisticRead:
      commonFindTest(
      "testFind(Read,Commit/PessimisticRead,Rollback)",
      LockModeType.READ, Act.CommitTx, 1, null,
      LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 1, null);

      If the find by the second child [Thread-8] is executed before the jdbc commit of the update statement by the first child [Thread-7], the test will fail. Attached are the trace file for the successful run and failing run.

      1. trace_success.txt
        10 kB
        Fay Wang
      2. trace_fail.txt
        12 kB
        Fay Wang

        Activity

        Fay Wang created issue -
        Fay Wang made changes -
        Field Original Value New Value
        Attachment trace_fail.txt [ 12450911 ]
        Attachment trace_success.txt [ 12450912 ]
        Albert Lee committed 984147 (13 files)
        Reviews: none

        OPENJPA-1753 a) remove unneeded import, b) close and clean up em using add Act.CloseEm, c) add better diagnostic info in SequenceActionsTest and d) clean up and update find/lock permutation tests for more consistent testing.

        openjpa trunk
        Albert Lee committed 984243 (1 file)
        Hide
        Albert Lee added a comment -

        Need to set postgresql.conf property max_connection >= 150, otherwise will get exception like:

        TestMixedLockManagerLockPermutation.testLockWriteRead View test details (org.apache.openjpa.persistence.lockmgr)
        <openjpa-2.1.0-SNAPSHOT-rexported fatal store error> org.apache.openjpa.util.StoreException: Cannot create PoolableConnectionFactory (FATAL: sorry, too many clients already)
        at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
        at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:599)

        Show
        Albert Lee added a comment - Need to set postgresql.conf property max_connection >= 150, otherwise will get exception like: TestMixedLockManagerLockPermutation.testLockWriteRead View test details (org.apache.openjpa.persistence.lockmgr) <openjpa-2.1.0-SNAPSHOT-rexported fatal store error> org.apache.openjpa.util.StoreException: Cannot create PoolableConnectionFactory (FATAL: sorry, too many clients already) at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:599)
        Albert Lee made changes -
        Assignee Albert Lee [ allee8285 ]
        Albert Lee committed 985280 (12 files)
        Reviews: none

        OPENJPA-1753 Update same test case changes from trunk to 2.0.x.

        openjpa 2.0.x
        Albert Lee made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.1 [ 12314532 ]
        Resolution Fixed [ 1 ]
        Hide
        Michael Dick added a comment -

        Closing issues which have been resolved for some time. If the problem persists, please reopen.

        Show
        Michael Dick added a comment - Closing issues which have been resolved for some time. If the problem persists, please reopen.
        Michael Dick made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Albert Lee
            Reporter:
            Fay Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development