open-consul/sdk
Daniel Nephin e456945466 sdk/retry: a few small debug improvements
On a few occasions I've had to read timeout stack traces for tests and
noticed that retry.Run runs the function in a goroutine. This makes
debuging a timeout more difficult because the gourinte of the retryable
function is disconnected from the stack of the actual test. It requires
searching through the entire stack trace to find the other goroutine.

By using panic instead of runtime.Goexit() we remove the need for a
separate goroutine.

Also a few other small improvements:
* add `R.Helper` so that an assertion function can be used with both
  testing.T and retry.R.
* Pass t to `Retryer.NextOr`, and call `t.Helper` in a number of places
  so that the line number reported by `t.Log` is the line in the test
  where `retry.Run` was called, instead of some line in `retry.go` that
  is not relevant to the failure.
* improve the implementation of `dedup` by removing the need to iterate
  twice. Instad track the lines and skip any duplicate when writing to
  the buffer.
2021-04-21 17:10:46 -04:00
..
freeport sdk: read procfs instead of using sysctl command 2020-10-25 00:37:04 +08:00
iptables cli: Add new consul connect redirect-traffic command for applying traffic redirection rules when Transparent Proxy is enabled. (#9910) 2021-04-09 11:48:10 -07:00
testutil sdk/retry: a few small debug improvements 2021-04-21 17:10:46 -04:00
.golangci.yml ci: Use golangci-lint for linting 2020-03-17 13:43:40 -04:00
go.mod cli: Add new consul connect redirect-traffic command for applying traffic redirection rules when Transparent Proxy is enabled. (#9910) 2021-04-09 11:48:10 -07:00
go.sum Allow users to configure either unstructured or JSON logging (#7130) 2020-01-28 17:50:41 -06:00
README.md Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00

Internal SDK

Please note that this folder, while public, is not meant for new consumers of these libraries; this should currently be considered an internal, not external, SDK. It is public due to existing needs from other HashiCorp software. The tags in this folder will stay at the 0.x.y level; accordingly users should expect that things can move around, disappear, or change API at any time.