File tree Expand file tree Collapse file tree 3 files changed +57
-3
lines changed
Expand file tree Collapse file tree 3 files changed +57
-3
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,12 @@ prepare_server() {
186186 version=$2
187187
188188 url=http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-$arch -$version .tgz
189+ prepare_server_from_url $url
190+ }
191+
192+ prepare_server_from_url () {
193+ url=$1
194+
189195 mongodb_dir=" $MONGO_ORCHESTRATION_HOME " /mdb
190196 mkdir -p " $mongodb_dir "
191197 curl --retry 3 $url | tar xz -C " $mongodb_dir " -f -
Original file line number Diff line number Diff line change @@ -23,9 +23,27 @@ setup_ruby
2323
2424install_deps
2525
26- arch=ubuntu1404
27- version=4.0.9
28- prepare_server $arch $version
26+ arch=` host_arch`
27+
28+ desired_version=$MONGODB_VERSION
29+ if test -n " $MMAPV1 " && test " $desired_version " = 4.0; then
30+ # 4.0.13 segfaults on mmapv1 - https://jira.mongodb.org/browse/SERVER-43079
31+ prepare_server $arch 4.0.9
32+ else
33+ prog=` cat << -EOT
34+ import urllib, json
35+ url = 'http://downloads.mongodb.org/current.json'
36+ info = json.load(urllib.urlopen(url))
37+ info = [i for i in info['versions'] if i['version'].startswith('$MONGODB_VERSION ')][0]
38+ info = [i for i in info['downloads'] if i['archive']['url'].find('enterprise-$arch ') > 0][0]
39+ url = info['archive']['url']
40+ print(url)
41+ EOT`
42+
43+ url=` python -c "$prog "`
44+
45+ prepare_server_from_url $url
46+ fi
2947
3048install_mlaunch
3149
@@ -58,6 +76,12 @@ bundle --version
5876export MONGODB_URI=" mongodb://localhost:27017/?serverSelectionTimeoutMS=30000$uri_options "
5977bundle exec rake spec:prepare
6078
79+ if test " $TOPOLOGY " = sharded_cluster && test $MONGODB_VERSION = 3.6; then
80+ # On 3.6 server the sessions collection is not immediately available,
81+ # wait for it to spring into existence
82+ bundle exec rake spec:wait_for_sessions
83+ fi
84+
6185export MONGODB_URI=" mongodb://localhost:27017/?appName=test-suite$uri_options "
6286bundle exec rake spec:ci
6387test_status=$?
Original file line number Diff line number Diff line change @@ -34,6 +34,30 @@ namespace :spec do
3434 SpecSetup . new . run
3535 end
3636
37+ desc 'Waits for sessions to be available in the deployment'
38+ task :wait_for_sessions do
39+ $: << File . join ( File . dirname ( __FILE__ ) , 'spec' )
40+
41+ require 'support/utils'
42+ require 'support/spec_config'
43+ require 'support/client_registry'
44+
45+ client = ClientRegistry . instance . global_client ( 'authorized' )
46+ client . database . command ( ping : 1 )
47+ deadline = Time . now + 300
48+ while Time . now < deadline
49+ if client . cluster . send ( :sessions_supported? )
50+ break
51+ end
52+ sleep 1
53+ client . close
54+ client . reconnect
55+ end
56+ unless client . cluster . send ( :sessions_supported? )
57+ raise "Sessions did not become supported in the allowed time"
58+ end
59+ end
60+
3761 desc 'Prints configuration used by the test suite'
3862 task :config do
3963 $: << File . join ( File . dirname ( __FILE__ ) , 'spec' )
You can’t perform that action at this time.
0 commit comments