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

after delegate is not firing or not firing consistently #10

Open
KarsonAlford opened this issue May 19, 2014 · 3 comments
Open

after delegate is not firing or not firing consistently #10

KarsonAlford opened this issue May 19, 2014 · 3 comments

Comments

@KarsonAlford
Copy link
Contributor

As NCrunch runs tests other tests that use dates are being affected by the india culture set in the before of other tests.

I have not ran this in TFS or R# yet.

    before initialize = () =>
    {
        Thread.CurrentThread.CurrentCulture = new CultureInfo("te-IN");
    };

    after clean_up = () =>
    {
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
    };
@copypastedeveloper
Copy link
Owner

are you sure ncrunch isn't running your tests in parallel? also, just to be clear, each scenario runs the before and after statements once, not once per then. not sure if that's well documented.

@KarsonAlford
Copy link
Contributor Author

I have attempted to turn off all NCrunch parallelism, and have not encounter this as often.

However, in the spirit of each test "running in isolation" or in this case each test "running in scenario isolation" we may want to consider enforcing scenario scoping of globals (such as thread context).

@copypastedeveloper
Copy link
Owner

I think that is a reasonable idea. I can add that as a feature request.

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

No branches or pull requests

2 participants