Race condition with data items' initialization caused sporadic test failures #34
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.
Patrick, thank you a lot for supporting the tests I added. It makes very easy for me migration to a newer version of MTConnect.NET since I can always refer to the updated tests in your repository.
Please read a problem description below. If you have any better solution than applied, please share it with me.
Adapter client initialized all its data items, setting them to UNAVAILABLE
Lest creating race condition we should wait until all items are initialized in OnConnect (see ShdrClient.ListenForAdapter)
The essence of race condition was that a data item might be sent via adapter EARLIER than adapter client initialized the same data item to UNAVAILABLE.
As a result MTConnectAgent.FilterPeriod was discarding new value coming via adapter due to older timestamp assigned on sending.
I have chosen ShdrClient.PingSent event, since ShdrClient.Listening was not called.