| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. | 1 // Copyright 2015 The LUCI Authors. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 }) | 102 }) |
| 103 So(tls.State.TerminalIndex, ShouldEqual,
1337) | 103 So(tls.State.TerminalIndex, ShouldEqual,
1337) |
| 104 So(tls.State.Terminated(), ShouldBeTrue) | 104 So(tls.State.Terminated(), ShouldBeTrue) |
| 105 So(tls.State.ArchivalState(), ShouldEqua
l, coordinator.NotArchived) | 105 So(tls.State.ArchivalState(), ShouldEqua
l, coordinator.NotArchived) |
| 106 | 106 |
| 107 Convey(`Replaces the pessimistic archiva
l mutation with an optimistic one.`, func() { | 107 Convey(`Replaces the pessimistic archiva
l mutation with an optimistic one.`, func() { |
| 108 // We have replaced the pessimis
tic archival mutation with an | 108 // We have replaced the pessimis
tic archival mutation with an |
| 109 // optimistic one. Assert that t
his happened by advancing time by | 109 // optimistic one. Assert that t
his happened by advancing time by |
| 110 // the optimistic period and con
firming the published archival | 110 // the optimistic period and con
firming the published archival |
| 111 // request. | 111 // request. |
| 112 » » » » » » env.IterateTumbleAll(c) | 112 » » » » » » env.RunTaskQueues(c, tls) |
| 113 So(env.ArchivalPublisher.Hashes(
), ShouldResemble, []string{}) | 113 So(env.ArchivalPublisher.Hashes(
), ShouldResemble, []string{}) |
| 114 | 114 |
| 115 // Add our settle delay, confirm
that archival is scheduled. | 115 // Add our settle delay, confirm
that archival is scheduled. |
| 116 env.Clock.Add(10 * time.Second) | 116 env.Clock.Add(10 * time.Second) |
| 117 » » » » » » env.IterateTumbleAll(c) | 117 » » » » » » env.RunTaskQueues(c, tls) |
| 118 So(env.ArchivalPublisher.Hashes(
), ShouldResemble, []string{string(tls.Stream.ID)}) | 118 So(env.ArchivalPublisher.Hashes(
), ShouldResemble, []string{string(tls.Stream.ID)}) |
| 119 | 119 |
| 120 // Add our pessimistic delay, co
nfirm that no additional tasks | 120 // Add our pessimistic delay, co
nfirm that no additional tasks |
| 121 // are scheduled (because pessim
istic was replaced). | 121 // are scheduled (because pessim
istic was replaced). |
| 122 env.ArchivalPublisher.Clear() | 122 env.ArchivalPublisher.Clear() |
| 123 env.Clock.Add(time.Hour) | 123 env.Clock.Add(time.Hour) |
| 124 » » » » » » env.IterateTumbleAll(c) | 124 » » » » » » env.RunTaskQueues(c, tls) |
| 125 So(env.ArchivalPublisher.Hashes(
), ShouldResemble, []string{}) | 125 So(env.ArchivalPublisher.Hashes(
), ShouldResemble, []string{}) |
| 126 }) | 126 }) |
| 127 | 127 |
| 128 Convey(`Can be marked terminal again (id
empotent).`, func() { | 128 Convey(`Can be marked terminal again (id
empotent).`, func() { |
| 129 _, err := svr.TerminateStream(c,
&req) | 129 _, err := svr.TerminateStream(c,
&req) |
| 130 So(err, ShouldBeRPCOK) | 130 So(err, ShouldBeRPCOK) |
| 131 | 131 |
| 132 // Reload state and confirm. | 132 // Reload state and confirm. |
| 133 So(tls.Get(c), ShouldBeNil) | 133 So(tls.Get(c), ShouldBeNil) |
| 134 | 134 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 }) | 233 }) |
| 234 | 234 |
| 235 So(getParams(), ShouldResemble, &coordinator.Arc
hivalParams{ | 235 So(getParams(), ShouldResemble, &coordinator.Arc
hivalParams{ |
| 236 SettleDelay: 10 * time.Second, | 236 SettleDelay: 10 * time.Second, |
| 237 CompletePeriod: 0, | 237 CompletePeriod: 0, |
| 238 }) | 238 }) |
| 239 }) | 239 }) |
| 240 }) | 240 }) |
| 241 }) | 241 }) |
| 242 } | 242 } |
| OLD | NEW |