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

Update CONTRIBUTING.md to avoid sleep and use gnmi.Watch #3737

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ Do not write [assertion] helpers.

[assertion]: https://go.dev/doc/faq#assertions

## Use gnmi.Watch with Await instead of sleep in tests

Avoid using time.Sleep to wait for a change to occur in a test. Instead use
gnmi.Watch with .Await in an appropriate validation function call. See the
[ONDATRA best practice on avoiding use of sleep in tests](https://pkg.go.dev/github.com/openconfig/ondatra/gnmi#hdr-Best_Practice__Avoid_time_Sleep).

## Enum

Sometimes a test may need to set a ygot field with an OpenConfig enum type, e.g.
Expand Down
Loading