Set state context in test for template compilability with infinite lineage.