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

Combinations of tests result in zero coverage #133

Closed
nickrodda opened this issue Jun 26, 2018 · 7 comments
Closed

Combinations of tests result in zero coverage #133

nickrodda opened this issue Jun 26, 2018 · 7 comments

Comments

@nickrodda
Copy link

Hi - I've just started using coverlet and the majority of our coverage tests run fine. However - one project has close to zero coverage. Running a small subset of the tests I am able to obtain results. Adding additional tests results in the coverage dropping to zero. It does not seem to matter which test is added.

I have determined that when this does not work, it is because CurrentDomain_ProcessExit is never called. I've updated our sdk version and also tried the solution in #101 which worked to a limited extent.

Does anyone have any suggestions as to how to get this working?

TIA

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 28, 2018

Hi @nickrodda, quick question; are you using the latest version of coverlet?

@nickrodda
Copy link
Author

Hi @tonerdo - yes I'm using the latest version. I've found that dropping the check in MarkExecuted from 100000 to 10000 results in all of the files being written and us getting coverage again.

In the specific case I was looking at, the markers count was approx. 91k and hence it was relying on the final write in CurrentDomain_ProcessExit working properly in order to get anything.

This is making me think that either the final writes are taking too long, or there is some kind of race issue with the lock. Any thoughts? Thanks

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 29, 2018

@nickrodda I'm planning on switching from writing hits to a file to instead writing it to a named pipe, so that the necessary data needed to calculate coverage is built up while the tests are running. CurrentDomain_ProcessExit will just be for disposing the connection. I'm hoping to have this fix in and released by next Monday

@nickrodda
Copy link
Author

@tonerdo

Great. Just to let you know and contrary to what I said in my original post, CurrentDomain_ProcessExit does get called. However after writing approx. 125k lines to files it exits without outputting all of the coverage. This is why the change in the file size limit helped.

Cheers

@petli
Copy link
Collaborator

petli commented Jun 29, 2018

@nickrodda, in the meantime you could give #134 a go if you want to see if that helps. It should generally write fewer lines to the files, which might mean that you don't end up hitting the file problem.

@nickrodda
Copy link
Author

@petli - thanks for that. Will give it a go.

@nickrodda
Copy link
Author

@tonerdo @petli - just tested 2.1.0 and this issue is resolved (plus it's much faster). Thanks

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

3 participants