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

Enforce that initial EventIds are deterministic #375

Merged
merged 4 commits into from
Jul 22, 2024

Conversation

koepalex
Copy link
Contributor

@koepalex koepalex commented Jul 22, 2024

Purpose

EventIds are currently generate for each OPC PLC restart and each event, which makes testing against it, much harder. Thios change follows the pattern of the ReferenceNodeManager and generate deterministic IDs.

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[x] Other... Please describe:

How to Test

git clone this repository
start the OPC PLC with `--autoaccept --alm`
  • navigate to

image

What to Check

Verify that the following are valid

  • After multiple restarts the initial EventId of the Node is the same

Other Information

Copy link
Collaborator

@luiscantero luiscantero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

private byte[] GetNextGuidAsByteArray()
{
// unpack the object to Uuid and then explicit cast to Guid to access the byte[]
// using RandomGenerator with known known seed to get reproducible results
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// using RandomGenerator with known known seed to get reproducible results
// using a random generator with a known seed to get reproducible results.

@luiscantero luiscantero merged commit d1944c9 into Azure-Samples:main Jul 22, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants