Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

CurrentTreeConstructionNodeReport: fix for nested container nodes#1632

Merged
onsi merged 1 commit intoonsi:masterfrom
pohly:CurrentTreeConstructionNodeReport-fix
Jan 8, 2026
Merged

CurrentTreeConstructionNodeReport: fix for nested container nodes#1632
onsi merged 1 commit intoonsi:masterfrom
pohly:CurrentTreeConstructionNodeReport-fix

Conversation

@pohly
Copy link
Contributor

@pohly pohly commented Jan 8, 2026

In the following tree, the code cleaning up after the inner container node set a nil current construction node report, causing
CurrentTreeConstructionNodeReport to panic with "CurrentConstructionNodeReport may only be called during construction of the spec tree" when called by the transformer for the following It:

var _ = Describe("outer", func() {
    Context("inner", func() {
        ...
    })
    It("works", func() { ... })
})

The fix is to restore the old value instead of setting to nil.

Found when using the new functionality for real in kubernetes/kubernetes#134708. The fix has been tested there.

In the following tree, the code cleaning up after the inner container node set
a nil current construction node report, causing
CurrentTreeConstructionNodeReport to panic with "CurrentConstructionNodeReport
may only be called during construction of the spec tree" when called by the
transformer for the following It:

    var _ = Describe("outer", func() {
        Context("inner", func() {
            ...
        })
        It("works", func() { ... })
    })

The fix is to restore the old value instead of setting to nil.
@onsi onsi merged commit 59bc751 into onsi:master Jan 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants