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

Unified Diff: appengine/logdog/coordinator/endpoints/logs/query_test.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Minor fixes, works in dev now. Created 4 years, 8 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: appengine/logdog/coordinator/endpoints/logs/query_test.go
diff --git a/appengine/logdog/coordinator/endpoints/logs/query_test.go b/appengine/logdog/coordinator/endpoints/logs/query_test.go
index d30450b7827f60fcc0f402ec067896c96325da64..a9ac3e30dda9ece16dff631442e8f9f6c4238a5b 100644
--- a/appengine/logdog/coordinator/endpoints/logs/query_test.go
+++ b/appengine/logdog/coordinator/endpoints/logs/query_test.go
@@ -153,6 +153,7 @@ func TestQuery(t *testing.T) {
ls := ct.TestLogStream(c, desc)
+ now := tc.Now().UTC()
psegs := prefix.Segments()
if psegs[0] == "meta" {
for _, p := range psegs[1:] {
@@ -161,13 +162,18 @@ func TestQuery(t *testing.T) {
ls.Purged = true
case "terminated":
- ls.State = coordinator.LSTerminated
ls.TerminalIndex = 1337
+ ls.TerminatedTime = now
case "archived":
- ls.ArchiveStreamURL = "http://example.com"
ls.State = coordinator.LSArchived
+ ls.TerminalIndex = 1337
+ ls.TerminatedTime = now
+
+ ls.ArchiveStreamURL = "http://example.com"
+ ls.ArchivedTime = now
+
case "datagram":
ls.StreamType = logpb.StreamType_DATAGRAM
@@ -177,7 +183,7 @@ func TestQuery(t *testing.T) {
}
}
- if err := ls.Put(ds.Get(c)); err != nil {
+ if err := ds.Get(c).Put(ls); err != nil {
panic(fmt.Errorf("failed to put log stream %d: %v", i, err))
}
@@ -270,7 +276,7 @@ func TestQuery(t *testing.T) {
})
Convey(`When not requesting protobufs, and with a corrupt descriptor, returns InternalServer error.`, func() {
- // We can't use "stream.Put" here because it validates the protobuf!
+ stream.SetDSValidate(false)
stream.Descriptor = []byte{0x00} // Invalid protobuf, zero tag.
So(di.Put(stream), ShouldBeNil)
di.Testable().CatchupIndexes()

Powered by Google App Engine
This is Rietveld 408576698