Describe the bug Seems ArchaiusAutoConfiguration do not do it's work, when new application context is configured by SpringBootTestContextBootstrapper in multi tests mode and if all tests have different with different context (different test property sources for example). As a result, we have wrong Archaius config list, that contains stale spring environment object (from first test executed).

We could workaraound here - AtomicBoolean initialized variable in ArchaiusAutoConfiguration could be set to false, if we destroy context (for example use @DirtiesContext annotation). But we would like to save our context for optimization purposes

Can we do something here, except destroying previous contexts? Thanks for advice

Sample

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@SpringBootTest(
        properties = {
                "prop1 = false",
})
public class Sample1Test {
     //some tests here
}

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@SpringBootTest(
        properties = {
                "prop1 = true",
})
public class Sample2Test {
     //some tests here
}

expected in Sample2Test: DynamicProperty.getInstance("prop1") is true, but false returned, cause spring env from Sample1Test live in archaius config-lists

Comment From: spencergibb

This module has entered maintenance mode. This means that the Spring Cloud team will no longer be adding new features to the module. We will fix blocker bugs (bugs that don't have a work around like this one does) and security issues, and we will also consider and review small pull requests from the community.