Skip to content

Commit 8276e37

Browse files
committed
stale test
1 parent 1809a89 commit 8276e37

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

test/elixir/test/config/nouveau.elixir

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"purge with conflicts",
3131
"index same field with different field types",
3232
"index not found",
33-
"meta"
33+
"meta",
34+
"stale search"
3435
]
3536
}

test/elixir/test/nouveau_test.exs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,23 @@ defmodule NouveauTest do
694694
assert resp.body["update_latency"] > 0
695695
end
696696

697+
@tag :with_db
698+
test "stale search", context do
699+
db_name = context[:db_name]
700+
url = "/#{db_name}/_design/foo/_nouveau/bar"
701+
create_ddoc(db_name)
702+
703+
resp = Couch.get(url, query: %{q: "*:*", update: false, include_docs: true})
704+
assert_status_code(resp, 404)
705+
706+
create_search_docs(db_name)
707+
resp = Couch.get(url, query: %{q: "*:*", include_docs: true})
708+
assert_status_code(resp, 200)
709+
ids = get_ids(resp)
710+
# nouveau sorts by _id as tie-breaker
711+
assert ids == ["doc1", "doc2", "doc3", "doc4"]
712+
end
713+
697714
def seq(str) do
698715
String.to_integer(hd(Regex.run(~r/^[0-9]+/, str)))
699716
end

0 commit comments

Comments
 (0)