Resolves #699 Intermittent failure was due to Thread.sleep in the code #802
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #699
While performing unit test cases there was race condition between two threads, so it was not guaranteed to work every time. Used an interface
DelayProvider
for simulating delay, and while unit testing fake delay provider is used that eradicates the use of Threads in unit test cases, which is not a good practice.This issue could also have been resolved by increasing the
Thread.sleep(50)
interval to higher value, but being design patterns repository I opted for better approach of not using threads when unit testing, due to complication of unit testing.DelayProvider
is an internal class so I am not sure if we should incorporate it in class diagramDelayProvider
?