fix: resolve pending and jumping
This commit is contained in:
@@ -145,7 +145,7 @@ func TestRequestCoordinatorCancelsSupersededRequest(t *testing.T) {
|
||||
var coordinator requestCoordinator
|
||||
first, cancelFirst, firstID := coordinator.start(time.Minute)
|
||||
defer cancelFirst()
|
||||
_, cancelSecond, secondID := coordinator.start(time.Minute)
|
||||
second, cancelSecond, secondID := coordinator.start(time.Minute)
|
||||
defer cancelSecond()
|
||||
select {
|
||||
case <-first.Done():
|
||||
@@ -159,6 +159,16 @@ func TestRequestCoordinatorCancelsSupersededRequest(t *testing.T) {
|
||||
if !errors.Is(first.Err(), context.Canceled) {
|
||||
t.Fatalf("first context error = %v", first.Err())
|
||||
}
|
||||
claimedID := coordinator.supersede()
|
||||
select {
|
||||
case <-second.Done():
|
||||
default:
|
||||
t.Fatal("claimed snapshot did not cancel the active request")
|
||||
}
|
||||
if coordinator.current(secondID) || !coordinator.current(claimedID) {
|
||||
t.Fatalf("claimed request ids: second=%t claimed=%t",
|
||||
coordinator.current(secondID), coordinator.current(claimedID))
|
||||
}
|
||||
}
|
||||
|
||||
func TestPartialRefreshPreservesLastCompleteSubsections(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user