Stefan Seifert created SLING-10944:
--------------------------------------
Summary: 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
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)