Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(761)

Unified Diff: logdog/server/collector/coordinator/cache_test.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: more refactor Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: logdog/server/collector/coordinator/cache_test.go
diff --git a/logdog/server/collector/coordinator/cache_test.go b/logdog/server/collector/coordinator/cache_test.go
index e546ac46ebbed60eaa0adb3f39469f32982b62f8..43235e0a150de44ca41bc8783ca4cf2dd17188fd 100644
--- a/logdog/server/collector/coordinator/cache_test.go
+++ b/logdog/server/collector/coordinator/cache_test.go
@@ -13,6 +13,7 @@ import (
"github.com/luci/luci-go/common/clock/testclock"
"github.com/luci/luci-go/common/errors"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/logdog/common/types"
"github.com/luci/luci-go/luci_config/common/cfgtypes"
@@ -245,7 +246,7 @@ func TestStreamStateCache(t *testing.T) {
Convey(`RegisterStream`, func() {
Convey(`A transient registration error will result in a RegisterStream error.`, func() {
tcc.errC = make(chan error, 1)
- tcc.errC <- errors.WrapTransient(errors.New("test error"))
+ tcc.errC <- errors.New("test error", transient.Tag)
_, err := ssc.RegisterStream(c, &st, nil)
So(err, ShouldNotBeNil)
@@ -287,10 +288,10 @@ func TestStreamStateCache(t *testing.T) {
Convey(`The termination endpoint returns a transient error, it will propagate.`, func() {
tcc.errC = make(chan error, 1)
- tcc.errC <- errors.WrapTransient(errors.New("test error"))
+ tcc.errC <- errors.New("test error", transient.Tag)
err := ssc.TerminateStream(c, &tr)
- So(errors.IsTransient(err), ShouldBeTrue)
+ So(transient.Tag.In(err), ShouldBeTrue)
So(tcc.calls, ShouldEqual, 1)
Convey(`A second attempt will call through, try again, and succeed.`, func() {

Powered by Google App Engine
This is Rietveld 408576698