Skip to content

Commit

Permalink
Update CONTRIBUTING.md to avoid sleep and use gnmi.Watch
Browse files Browse the repository at this point in the history
  • Loading branch information
dplore authored Jan 30, 2025
1 parent b02122c commit 3581ff8
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 3581ff8

Please sign in to comment.