Skip to content

Commit

Permalink
Merge pull request #4317 from vespa-engine/vekterli/test-docapi-v1-vi…
Browse files Browse the repository at this point in the history
…sit-with-stream

Extend Document V1 API continuation visiting test with `stream=true`
  • Loading branch information
vekterli authored Jan 16, 2025
2 parents a3c21b6 + 75caeb8 commit 24fc1a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/document_api_v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DocumentApiV1
attr_reader :host, :port

@@known_request_params = [:concurrency, :condition, :create, :cluster, :continuation, "format.tensors",
:fieldSet, :route, :selection, :wantedDocumentCount, :bucketSpace].to_set
:fieldSet, :route, :selection, :wantedDocumentCount, :bucketSpace, :stream].to_set

def initialize(host, port, test_case)
@host = host
Expand Down
10 changes: 8 additions & 2 deletions tests/vds/documentapi/visit_many_documents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class VisitManyDocumentsTest < VdsTest

def setup
set_owner("geirst")
set_owner('vekterli')
deploy_app(default_app.distribution_bits(8))
container = (vespa.qrserver["0"] or vespa.container.values.first)
@tmp_bin_dir = container.create_tmp_bin_dir
Expand All @@ -27,9 +27,15 @@ def feed_documents
def test_visit_many_documents
set_description("Test visiting of many documents using continuation token")
feed_documents
[false, true].each { |stream|
visit_with_continuation(stream)
}
end

def visit_with_continuation(stream)
puts "Visiting via Document V1 API with stream=#{stream}"
doc_ids = Set.new
params = {:selection => "music", :cluster => "storage", :wantedDocumentCount => @wanted_doc_count}
params = {:selection => "music", :cluster => "storage", :wantedDocumentCount => @wanted_doc_count, :stream => stream}
continuation = nil
visit_count = 0
loop do
Expand Down

0 comments on commit 24fc1a7

Please sign in to comment.