-
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Update to singleton unit tests and lazy loading unit test #263
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
Conversation
…ingle thread environment and multithread environment. Also add a test to demonstrate a whole with Singleton when instantiating using reflection
…ingle thread environment and multithread environment. Also add a test to demonstrate a whole with Singleton when instantiating using reflection Add some logging. Tests pass locally but not on github?
|
adding some logging on my next commit. I cannot see where the error is because the tests pass locally |
|
There seems to be intermittent failures in |
|
Hi iluwatar, Yes I can reproduce it. I put the test in a loop of 2000 iterations and I got it after a couple of runs. i'll investigate. Thanks |
|
Hi iluwatar, I have run the test in a loop of 5000 and run this about 20 times. No error now. Thanks for spotting. I had to use a syncrhonized list as it was being manipulated by multiple threads. I pushed the code about 30 minutes ago. The build seems to ahve failed on coverage/coveralls. I only added the syncrhonised bit to the list. What do I need to do to get this working. Sorry im new to GitHub. |
|
Good job @iamrichardjones It seems to work now. |
Update to singleton unit tests and lazy loading unit test
Add additional unit tests to show that singletons can be created in single thread environment and multithread environment. Also add a test to demonstrate a whole with Singleton when instantiating using reflection
(first ever pull request so if ive done something wrong or broken etiquette then apologies and let me know - thanks)