You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (Jira)" <ji...@apache.org> on 2021/11/26 22:36:00 UTC

[jira] [Resolved] (SLING-10944) sling-mock: Tear down MockSlingBindings on context tear down

     [ https://issues.apache.org/jira/browse/SLING-10944?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Seifert resolved SLING-10944.
------------------------------------
    Resolution: Fixed

https://github.com/apache/sling-org-apache-sling-testing-sling-mock/commit/a223de695f7ce3b55e51767ac58874a0fac08adf

> sling-mock: Tear down MockSlingBindings on context tear down
> ------------------------------------------------------------
>
>                 Key: SLING-10944
>                 URL: https://issues.apache.org/jira/browse/SLING-10944
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>            Reporter: Stefan Seifert
>            Assignee: Stefan Seifert
>            Priority: Major
>             Fix For: Testing Sling Mock 3.1.4
>
>
> MockSlingBindings is integrated in a complex fashion:
> * it's created together with a mock sling http serlvet request (stored as request attributes)
> * it holds a reference to the current context to get access to all context objects (e.g. current resource) which may change during test execution
> * additionally it listens to OSGi events for registering or unregistering BindingsValuesProvider instances and allows to get values from them as value
> the asynchronous handling of registering/unregistering events and accessing the context may lead to conflicts if the context is in process of shutting down, or already was shut down and an event reaches the instance later in time (OSGi events are processed asynchronously). esp. i may happen that other services which are deactivated are sending such events late in the chain of deactivations.
> such a racing condition seems to be the root case of the problems described in [WTES-69|https://wcm-io.atlassian.net/browse/WTES-69].



--
This message was sent by Atlassian Jira
(v8.20.1#820001)