Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-19422

UnrestrictedSessionRunner should not behave differently in Unit Test

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 8.2
    • Fix Version/s: 8.3
    • Component/s: Core

      Description

      Since NXP-14118 there is an extra session.save() in test mode for already unrestricted session.

      The session.save reads session invalidations from other transactions which makes unit test behave very differently than Nuxeo instance. This extra code should be removed.

      Note that the low level session (SQLSession/DBSSession) is shared by all high level session in the same transaction. It is not necessary to call session.save to load invalidation from other session in the same transaction.

        Attachments

          Issue Links

            Activity

            Hide
            bdelbosc Benoit Delbosc added a comment -

            A quick T&P (branch fix-NXP-19422-unrestricted-session-save) shows failure on
            org.nuxeo.ecm.platform.task.core.TaskServiceTest

            http://qa.nuxeo.org/jenkins/job/ondemand-testandpush-bdelbosc2/159/console

            Show
            bdelbosc Benoit Delbosc added a comment - A quick T&P (branch fix- NXP-19422 -unrestricted-session-save) shows failure on org.nuxeo.ecm.platform.task.core.TaskServiceTest http://qa.nuxeo.org/jenkins/job/ondemand-testandpush-bdelbosc2/159/console
            Hide
            bdelbosc Benoit Delbosc added a comment -

            The current state after removing the session.save from UnrestrictedSessionRunner, is that many tests must be updated to add this extra session.save():
            fix-NXP-19422-unrestricted-session-save branch:

            Still there are failures:

            • Nuxeo Platform Publisher task ...................... FAILURE [ 6.424 s] nuxeo-features/nuxeo-platform-publisher/nuxeo-platform-publisher-task
            • Nuxeo Routing Core ................................. FAILURE [ 17.703 s] addons/nuxeo-platform-document-routing/nuxeo-routing-api
            • Nuxeo Salesforce Web ............................... FAILURE [01:53 min] addons/nuxeo-salesforce

            So we need to decide if this is the behavior that we expect or not when using UnrestrictedSessionRunner.

            Show
            bdelbosc Benoit Delbosc added a comment - The current state after removing the session.save from UnrestrictedSessionRunner, is that many tests must be updated to add this extra session.save(): fix- NXP-19422 -unrestricted-session-save branch: https://github.com/nuxeo/nuxeo/commit/bcaad97f0342b770ab64a70884c7a1b8a7b68a27 https://github.com/nuxeo/nuxeo/commit/452fe8038b72035c0f7ab3d75b7750ed9443bf60 https://github.com/nuxeo/nuxeo/commit/6e12f44986f1ca501119f74a5e4c5e2ce5f073d1 https://github.com/nuxeo/nuxeo-quota/commit/96e7ae8e4f54bd42af315dbf4bb742c4c66c68c1 Still there are failures: Nuxeo Platform Publisher task ...................... FAILURE [ 6.424 s] nuxeo-features/nuxeo-platform-publisher/nuxeo-platform-publisher-task Nuxeo Routing Core ................................. FAILURE [ 17.703 s] addons/nuxeo-platform-document-routing/nuxeo-routing-api Nuxeo Salesforce Web ............................... FAILURE [01:53 min] addons/nuxeo-salesforce So we need to decide if this is the behavior that we expect or not when using UnrestrictedSessionRunner.
            Hide
            hudson Jenkins added a comment -

            SUCCESS: Integrated in nuxeo-master #1563
            NXP-19422: Test mode should not require extra session.save (jenkins: b894459486e0b586c164c057baa02a0f113ae39f)
            NXP-19422: fix unit test as Adminitrator it requires to save the session (jenkins: 551fa0a8ce02b0d5167951dcc55166565816476b)
            NXP-19422: fix unit test by adding explicit session.save (jenkins: b5583fe946a65a42fb555677e3020d1fe0af6b6e)
            NXP-19422: fix unit test by adding explicit session.save (jenkins: 1817bf64be71efd477c9337ec992ebb7c116af9c)

            Show
            hudson Jenkins added a comment - SUCCESS: Integrated in nuxeo-master #1563 NXP-19422 : Test mode should not require extra session.save (jenkins: b894459486e0b586c164c057baa02a0f113ae39f ) NXP-19422 : fix unit test as Adminitrator it requires to save the session (jenkins: 551fa0a8ce02b0d5167951dcc55166565816476b ) NXP-19422 : fix unit test by adding explicit session.save (jenkins: b5583fe946a65a42fb555677e3020d1fe0af6b6e ) NXP-19422 : fix unit test by adding explicit session.save (jenkins: 1817bf64be71efd477c9337ec992ebb7c116af9c )
            Hide
            hudson Jenkins added a comment -

            SUCCESS: Integrated in addons_nuxeo-quota-master #2480
            NXP-19422: fix unit test by adding explicit session.save (jenkins: b8e997c100f67a2c286d0cbdec859cb3d096178c)

            Show
            hudson Jenkins added a comment - SUCCESS: Integrated in addons_nuxeo-quota-master #2480 NXP-19422 : fix unit test by adding explicit session.save (jenkins: b8e997c100f67a2c286d0cbdec859cb3d096178c )
            Hide
            hudson Jenkins added a comment -

            SUCCESS: Integrated in addons_nuxeo-platform-document-routing-master #2970
            NXP-19422: fix unit test by adding explicit session.save (jenkins: e810ae3cd59a0b6b25393ac72aec7c82b004c03e)

            Show
            hudson Jenkins added a comment - SUCCESS: Integrated in addons_nuxeo-platform-document-routing-master #2970 NXP-19422 : fix unit test by adding explicit session.save (jenkins: e810ae3cd59a0b6b25393ac72aec7c82b004c03e )

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours, 2 minutes
                  5h 2m