fix: resolve pending and jumping

This commit is contained in:
2026-08-03 13:31:45 +02:00
parent 4fcc479779
commit 6f963c7660
9 changed files with 330 additions and 60 deletions

View File

@@ -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) {