Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suite: fix deadlock in suite.Require()/Assert() #1535

Merged
merged 1 commit into from
Feb 18, 2024

Commits on Feb 18, 2024

  1. suite: fix deadlock in suite.Require()/Assert()

    As pointed out in issue stretchr#1520, if the suite is not initialised properly
    (buy calling the Run function), then calling suite.Require() or
    suite.Assert() will result in a deadlock.
    
    This commit fixes that by panicking if the suite is not initialised
    properly. This is justified because, the suite is intended to be
    triggered in the right way. If the user does not do that, this panic will
    nudge them in the right direction.
    
    It has to be a panic because, at this point, we don't have access to any
    testing.T context to gracefully call a t.Fail(). Also, these two
    functions are not expected to return an error.
    
    Fixes stretchr#1520
    arjunmahishi committed Feb 18, 2024
    Configuration menu
    Copy the full SHA
    c41592b View commit details
    Browse the repository at this point in the history