This commit is contained in:
@@ -182,6 +182,27 @@ func TestSearchServiceFetchCacheRoundTrip(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSplitSearchDeadlinesReservesEnrichmentWindow(t *testing.T) {
|
||||
deadline := time.Now().Add(20 * time.Second)
|
||||
collectionDeadline, enrichmentDeadline := splitSearchDeadlines(deadline)
|
||||
|
||||
if enrichmentDeadline.IsZero() {
|
||||
t.Fatal("expected enrichment deadline to be preserved")
|
||||
}
|
||||
if !collectionDeadline.Before(enrichmentDeadline) {
|
||||
t.Fatalf("expected collection deadline before enrichment deadline, got %v >= %v", collectionDeadline, enrichmentDeadline)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSplitSearchDeadlinesDoesNotReserveWhenBudgetTooSmall(t *testing.T) {
|
||||
deadline := time.Now().Add(2 * time.Second)
|
||||
collectionDeadline, enrichmentDeadline := splitSearchDeadlines(deadline)
|
||||
|
||||
if !collectionDeadline.Equal(enrichmentDeadline) {
|
||||
t.Fatalf("expected identical deadlines, got %v and %v", collectionDeadline, enrichmentDeadline)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSearchServiceSkipsArtgridAPIAfter403(t *testing.T) {
|
||||
var apiRequests atomic.Int32
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user