File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 734734 ],
735735 "IgnoreDesignDocsForAllDocsIndexTests": [
736736 "should not return design docs"
737+ ],
738+ "LongRunningMangoTest": [
739+ "query does not time out"
737740 ]
738741}
Original file line number Diff line number Diff line change 1+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
2+ # use this file except in compliance with the License. You may obtain a copy of
3+ # the License at
4+ #
5+ # http://www.apache.org/licenses/LICENSE-2.0
6+ #
7+ # Unless required by applicable law or agreed to in writing, software
8+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10+ # License for the specific language governing permissions and limitations under
11+ # the License.
12+
13+ defmodule LongRunningMangoTest do
14+ use CouchTestCase
15+
16+ @ db_name "no-timeout"
17+
18+ setup do
19+ MangoDatabase . recreate ( @ db_name )
20+
21+ 0 .. 100_000
22+ |> Enum . reduce ( [ ] , fn i , docs ->
23+ docs = [ % { "_id" => "#{ i } " , "another" => "field" } | docs ]
24+
25+ if rem ( i , 20_000 ) == 0 do
26+ MangoDatabase . save_docs ( @ db_name , docs )
27+ [ ]
28+ else
29+ docs
30+ end
31+ end )
32+ end
33+
34+ test "query does not time out" do
35+ selector = % { "_id" => % { "$gt" => 0 } , "another" => "wrong" }
36+ { :ok , docs } = MangoDatabase . find ( @ db_name , selector )
37+ assert docs == [ ]
38+ end
39+ end
You can’t perform that action at this time.
0 commit comments