One more time: our `PP  extends ConfigurationClassPostProcessor` we override only `postProcessBeanDefinitionRegistry` for case to avoid double bean registration.
And in case `postProcessBeanDefinitionRegistry` has been invoked we change internal state of our instance using `DFA`.
`postProcessBeanFactory` is invoked anyway.
if `postProcessBeanDefinitionRegistry` was called (end `registriesPostProcessed` was added), within `postProcessBeanFactory` we do only enchancement.

But in case of this test the `postProcessBeanDefinitionRegistry` of our `PP` hasn't been invoked (don't know 'why?' - SPR issue), so all work will be done within `postProcessBeanFactory` of our `PP` and this work fix the issue for `<context:component-scan>` from config of this test.
I suggest you set break points in the `ConfigurationClassPostProcessor` and take a look how and when his methods are invoked