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

Missing value attribute in test parameters setting causes NullReferenceException in console #2390

rprouse opened this Issue Aug 28, 2017 · 0 comments


None yet
1 participant

rprouse commented Aug 28, 2017

@jnm2 commented on Mon Aug 28 2017

I've gotten this 7 times out of the last 9 builds on the build server at work. The only thing that should have changed from last night is that there's a lot more parallelization going on. Oh, also I updated to NUnit Framework 3.8.0, duh...

Run Settings
    DisposeRunners: True
    WorkDirectory: [redacted]
    TestParametersDictionary: System.NullReferenceException: Object reference not set to an instance of an object.
   at NUnit.ConsoleRunner.ColorConsoleWriter.WriteLabel(String label, Object option, ColorStyle valueStyle)
   at NUnit.ConsoleRunner.ColorConsoleWriter.WriteLabelLine(String label, Object option, ColorStyle valueStyle)
   at NUnit.ConsoleRunner.ResultReporter.WriteRunSettingsReport()
   at NUnit.ConsoleRunner.ResultReporter.ReportResults()
   at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
   at NUnit.ConsoleRunner.Program.Main(String[] args)

Fails with error -100.

@jnm2 commented on Mon Aug 28 2017

This looks like the only line that could possibly be causing the NRE: We should either write nothing or add an ArgumentNullException check to start with.

@jnm2 commented on Mon Aug 28 2017

And here is the root problem: needs to be updated in concert with #2382. We have a compatibility issue now that none of us thought of. Due to NUnit Console's NRE, NUnit Framework 3.8.0 is incompatible with NUnit Console 3.7.0 and earlier. Even without the NRE, there's no fallback so it would look like there are no test parameters and that may be a compat concern in itself.

Can we tag this issue integration test wishlist? ... 😟

/cc @ChrisMaddock @rprouse @CharliePoole

@rprouse commented on Mon Aug 28 2017

Well, damn. @CharliePoole was worried that removing the value attribute and moving it into the items might cause problems for transforms. None of us thought to check our own code and our own tests don't cause this to happen.

I think this warrants an emergency hotfix which I can do tonight. I think we have two options,

  1. Back out #2382
  2. Rework #2382 so that it is backwards compatible by including the dictionary settings as a single string and also include the individual elements for updated runners.
  3. Rework #2382 removing the child elements and just add the value.

My preference is for the second option. I can make the changes starting in about an hour.

@jnm2 will you be available this evening for code reviews?

@ChrisMaddock commented on Mon Aug 28 2017

2 sounds good to me too.

Is it worth investigation #2386 before doing a hotfix? That also sounds potentially critical.

@rprouse commented on Mon Aug 28 2017

@ChrisMaddock I agree, #2386 also looks serious, we should track both. I will comment there.

@rprouse commented on Mon Aug 28 2017

I am also going to copy this issue to the framework repo for the backwards compatible fix. We should also address this in the next release of the framework to display the child elements if available, so I will leave this open in this repo.

@rprouse rprouse self-assigned this Aug 28, 2017

@rprouse rprouse added this to the 3.8.1 milestone Aug 28, 2017

@rprouse rprouse added the closed:done label Aug 29, 2017

@rprouse rprouse closed this Aug 29, 2017

@jnm2 jnm2 changed the title from ColorConsoleWriter.WriteLabel causes NullReferenceException to Missing value attribute in test parameters setting causes NullReferenceException in console Aug 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment