[JIRA] (IDP-1967) Some IdP tests run with destroyed beans (because of Context lifetimes)

Rod Widdowson (Jira) jira at shibboleth.atlassian.net
Wed Jun 29 08:57:52 UTC 2022


Rod Widdowson ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=59fb32bbc24efb3c4ed3c977 ) *created* an issue

Identity Provider ( https://shibboleth.atlassian.net/browse/IDP?atlOrigin=eyJpIjoiZTUzY2NmZWM3M2QxNGE3Y2E0OGVkZDdiODhhNTE4YzYiLCJwIjoiaiJ9 ) / Bug ( https://shibboleth.atlassian.net/browse/IDP-1967?atlOrigin=eyJpIjoiZTUzY2NmZWM3M2QxNGE3Y2E0OGVkZDdiODhhNTE4YzYiLCJwIjoiaiJ9 ) IDP-1967 ( https://shibboleth.atlassian.net/browse/IDP-1967?atlOrigin=eyJpIjoiZTUzY2NmZWM3M2QxNGE3Y2E0OGVkZDdiODhhNTE4YzYiLCJwIjoiaiJ9 ) Some IdP tests run with destroyed beans (because of Context lifetimes) ( https://shibboleth.atlassian.net/browse/IDP-1967?atlOrigin=eyJpIjoiZTUzY2NmZWM3M2QxNGE3Y2E0OGVkZDdiODhhNTE4YzYiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 4.0.0, 4.1.0, 4.2.0, 4.2.1 Assignee: Rod Widdowson ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=59fb32bbc24efb3c4ed3c977 ) Components: Attribute Filter, SAML2 Created: 29/Jun/22 4:57 AM Fix Versions: 5.0.0 Priority: Trivial Reporter: Rod Widdowson ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=59fb32bbc24efb3c4ed3c977 )

I’m not sure whether this matters (yet) but I need to capture this).

Proceeding with https://shibboleth.atlassian.net/browse/JSPT-98 in the IdP I ran the tests and one test fails because it is working with destroyed beans. This in turn is because the code change involves checking for destroyed state as well as initialized state.

The specific problem is in FilterByQueriedAttributesTest#getBean() which looks roughly like this

   protected <Type> Type getBean(String fileName, Class<Type> claz) {

       try (final GenericApplicationContext context = new GenericApplicationContext()) {
          // Stuff
           return beans.iterator().next();
       }
   }

And the problem is that the AutoClose closes the context which calls destroy on all the contained beans.

I’m capturing this in a case so people see it and can think whether this generally matters.

The topical fix is to not defer the close of the context until the test is done, but I am not yet 100% sure that the malaise doesn’t run deeper.

( https://shibboleth.atlassian.net/browse/IDP-1967#add-comment?atlOrigin=eyJpIjoiZTUzY2NmZWM3M2QxNGE3Y2E0OGVkZDdiODhhNTE4YzYiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/IDP-1967#add-comment?atlOrigin=eyJpIjoiZTUzY2NmZWM3M2QxNGE3Y2E0OGVkZDdiODhhNTE4YzYiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100201- sha1:c6c9d1f )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20220629/42b84cb5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-113ad5b1-86fe-49da-b460-551c80bce288
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220629/42b84cb5/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-2732932f-a15b-4f74-9fcb-c9ffb977ad93
Type: image/png
Size: 563 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220629/42b84cb5/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-4cd009c3-4b83-4268-87e5-355f5bf6705b
Type: image/png
Size: 425 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220629/42b84cb5/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-8df72aa9-0540-4db4-a0fd-13d9754dee21
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220629/42b84cb5/attachment-0007.png>


More information about the commits mailing list