zookeeper 1.5.1-java → 1.5.4-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0857aaef4a9dfa6b71ca96fd4aadaa6dcb4d2ad7be916dbd6d0ae994e5fb70d3'
4
- data.tar.gz: 518129d5e5fb35b53225766926128272424a7f9c0cec6615880520a8ba948319
3
+ metadata.gz: f3654bf6a5f1c06004a95c7f5f4928f62218eaf6cf3be3921da2df54c6e989ef
4
+ data.tar.gz: a2818f836c18ef8e4a8f614d82a1a0d7d5dd171df3c04db0e0227262a4df2a15
5
5
  SHA512:
6
- metadata.gz: 8694d67c5a1b959fbde2707b9f2f4e1ee3dfd7afb53c9173de6d27b1a15f26531b201398b4e8487bfada8874e79f54737086c63cf87dd4c72c32112458a78dbd
7
- data.tar.gz: 59323715e3ec0eb4427b455ed6ade65deeaee46a0bcf0172e58038820053b1e854117f44b882da2d8ae187021f2957032f3f61aa6d5a6c415e8ab85ddc1a2e6d
6
+ metadata.gz: cbaa54afc1d1dc871293b5f2a252fcc461d3bc4f7613b65cb700ea495246735f0ce77cd8827311e95be683824c9f5e08b22dff76847638e0f154f5f49d1385b6
7
+ data.tar.gz: 50849ba02332a7cd03b420d44439223ff077d45dc7cc91c2f85981560ef7199388c2cd23b62d91157e92a6cd422224cfb439e8f8364f172adfe4d4c0e55da86e
@@ -15,19 +15,26 @@ jobs:
15
15
  matrix:
16
16
  os:
17
17
  - ubuntu-latest
18
+ - ubuntu-20.04
18
19
  - macos-latest
19
20
  ruby:
20
- - 2.5
21
- - 2.6
22
- - 2.7
23
- - 3.0
24
- - jruby
21
+ - '2.5'
22
+ - '2.6'
23
+ - '2.7'
24
+ - '3.0'
25
+ - '3.1'
26
+ - '3.2'
27
+ - 'jruby'
25
28
  gcc:
26
29
  - 7
27
30
  - latest
28
31
  exclude:
29
32
  - os: macos-latest
30
33
  gcc: 7
34
+ - os: ubuntu-latest
35
+ gcc: 7
36
+ - os: ubuntu-20.04
37
+ gcc: latest
31
38
 
32
39
  steps:
33
40
  - uses: actions/checkout@v2
@@ -46,6 +53,7 @@ jobs:
46
53
  with:
47
54
  ruby-version: ${{ matrix.ruby }}
48
55
  bundler-cache: true
56
+ cache-version: 1_${{ matrix.ruby }}_${{ matrix.os }}
49
57
 
50
58
  - name: Run Tests
51
59
  env:
data/.gitmodules CHANGED
@@ -1,3 +1,3 @@
1
1
  [submodule "releaseops"]
2
2
  path = releaseops
3
- url = git://github.com/slyphon/releaseops.git
3
+ url = https://github.com/zk-ruby/releaseops.git
data/CHANGELOG CHANGED
@@ -1,3 +1,13 @@
1
+ v1.5.4
2
+ * Ruby 3.2 compatibility (h/t: @cheister & @EricRoos)
3
+
4
+ v1.5.3
5
+ * Ruby 3.1 compatibility (h/t: @casperisfine)
6
+
7
+ v1.5.2 (YANKED)
8
+ * Ruby 3.1 compatibility and zookeeper client updates.
9
+ * This release had build issues in the wild and was yanked
10
+
1
11
  v1.5.1
2
12
  * Update config.guess to support newer environments (h/t: @malmckay)
3
13
 
data/Gemfile CHANGED
@@ -2,10 +2,10 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rake', '~> 0.9.0'
5
+ gem 'rake', '>= 13.0'
6
6
 
7
7
  group :test do
8
- gem "rspec" , "~> 2.11"
8
+ gem "rspec" , "~> 3.0"
9
9
  gem 'eventmachine', '1.0.4'
10
10
  gem 'evented-spec', '~> 0.9.0'
11
11
  gem 'zk-server', '~> 1.0', :git => 'https://github.com/zk-ruby/zk-server.git'
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ release_ops_path = File.expand_path('../releaseops/lib', __FILE__)
4
4
  # we use a submodule because it doesn't depend on anything else (*cough* bundler)
5
5
  # and can be shared across projects
6
6
  #
7
- if File.exists?(release_ops_path)
7
+ if File.exist?(release_ops_path)
8
8
  require File.join(release_ops_path, 'releaseops')
9
9
 
10
10
  # sets up the multi-ruby zk:test_all rake tasks
@@ -17,7 +17,7 @@ if File.exists?(release_ops_path)
17
17
  # Define a task to run code coverage tests
18
18
  ReleaseOps::TestTasks.define_simplecov_tasks
19
19
 
20
- # set up yard:server, yard:gems, and yard:clean tasks
20
+ # set up yard:server, yard:gems, and yard:clean tasks
21
21
  # for doing documentation stuff
22
22
  ReleaseOps::YardTasks.define
23
23
 
data/ext/Rakefile CHANGED
@@ -4,9 +4,9 @@ ZKRB_WRAPPER = %w[zkrb_wrapper.c zkrb_wrapper.h]
4
4
 
5
5
  namespace :zkrb do
6
6
  task :clean do
7
- if File.exists?('Makefile')
7
+ if File.exist?('Makefile')
8
8
  sh 'make clean'
9
- rm 'Makefile' # yep, regenerate this
9
+ FileUtils.rm('Makefile') # yep, regenerate this
10
10
  else
11
11
  $stderr.puts "nothing to clean, no Makefile"
12
12
  end
data/ext/extconf.rb CHANGED
@@ -58,7 +58,7 @@ Dir.chdir(HERE) do
58
58
  else
59
59
  puts "Building zkc."
60
60
 
61
- unless File.exists?('c')
61
+ unless File.exist?('c')
62
62
  safe_sh "tar xzf #{BUNDLE} 2>&1"
63
63
  PATCHES.each do |patch|
64
64
  safe_sh "patch -p0 < #{patch} 2>&1"
@@ -87,7 +87,7 @@ Dir.chdir("#{HERE}/lib") do
87
87
  %w[a la dylib].each do |ext|
88
88
  origin_lib_name = "libzookeeper_#{stmt}.#{ext}"
89
89
  dest_lib_name = "libzookeeper_#{stmt}_gem.#{ext}"
90
- system("cp -f #{origin_lib_name} #{dest_lib_name}") if File.exists?(origin_lib_name)
90
+ system("cp -f #{origin_lib_name} #{dest_lib_name}") if File.exist?(origin_lib_name)
91
91
  end
92
92
  end
93
93
  end
File without changes
data/ext/zkrb.c CHANGED
@@ -203,7 +203,6 @@ inline static int we_are_forked(zkrb_instance_data_t *zk) {
203
203
  return rv;
204
204
  }
205
205
 
206
-
207
206
  static int destroy_zkrb_instance(zkrb_instance_data_t* zk) {
208
207
  int rv = ZOK;
209
208
 
@@ -245,6 +244,11 @@ static void free_zkrb_instance_data(zkrb_instance_data_t* ptr) {
245
244
  destroy_zkrb_instance(ptr);
246
245
  }
247
246
 
247
+ VALUE alloc_zkrb_instance(VALUE klass) {
248
+ zkrb_instance_data_t* zk = ZALLOC_N(zkrb_instance_data_t, 1);
249
+ return Data_Wrap_Struct(klass, NULL, free_zkrb_instance_data, zk);
250
+ }
251
+
248
252
  static void print_zkrb_instance_data(zkrb_instance_data_t* ptr) {
249
253
  fprintf(stderr, "zkrb_instance_data (%p) {\n", ptr);
250
254
  fprintf(stderr, " zh = %p\n", ptr->zh);
@@ -1013,7 +1017,7 @@ static void zkrb_define_methods(void) {
1013
1017
  DEFINE_METHOD(close_handle, 0);
1014
1018
  DEFINE_METHOD(deterministic_conn_order, 1);
1015
1019
  DEFINE_METHOD(is_unrecoverable, 0);
1016
- DEFINE_METHOD(recv_timeout, 1);
1020
+ DEFINE_METHOD(recv_timeout, 0);
1017
1021
  DEFINE_METHOD(zkrb_state, 0);
1018
1022
  DEFINE_METHOD(sync, 2);
1019
1023
  DEFINE_METHOD(zkrb_iterate_event_loop, 0);
@@ -1063,6 +1067,7 @@ void Init_zookeeper_c() {
1063
1067
 
1064
1068
  /* initialize CZookeeper class */
1065
1069
  CZookeeper = rb_define_class_under(mZookeeper, "CZookeeper", rb_cObject);
1070
+ rb_define_alloc_func(CZookeeper, alloc_zkrb_instance);
1066
1071
  zkrb_define_methods();
1067
1072
 
1068
1073
  ZookeeperClientId = rb_define_class_under(CZookeeper, "ClientId", rb_cObject);
@@ -1,4 +1,4 @@
1
1
  module Zookeeper
2
- VERSION = '1.5.1'
2
+ VERSION = '1.5.4'
3
3
  DRIVER_VERSION = '3.4.5'
4
4
  end
File without changes
@@ -29,20 +29,20 @@ unless defined?(::JRUBY_VERSION)
29
29
  end
30
30
 
31
31
  it %[should be in connected state within a reasonable amount of time] do
32
- wait_until_connected.should be_true
32
+ expect(wait_until_connected).to be_truthy
33
33
  end
34
34
 
35
35
  describe :after_connected do
36
36
  before do
37
- wait_until_connected.should be_true
37
+ expect(wait_until_connected).to be_truthy
38
38
  end
39
39
 
40
40
  it %[should have a connection event after being connected] do
41
41
  event = wait_until(10) { @event_queue.pop }
42
- event.should be
43
- event[:req_id].should == Zookeeper::Constants::ZKRB_GLOBAL_CB_REQ
44
- event[:type].should == Zookeeper::Constants::ZOO_SESSION_EVENT
45
- event[:state].should == Zookeeper::Constants::ZOO_CONNECTED_STATE
42
+ expect(event).to be
43
+ expect(event[:req_id]).to eq(Zookeeper::Constants::ZKRB_GLOBAL_CB_REQ)
44
+ expect(event[:type]).to eq(Zookeeper::Constants::ZOO_SESSION_EVENT)
45
+ expect(event[:state]).to eq(Zookeeper::Constants::ZOO_CONNECTED_STATE)
46
46
  end
47
47
  end
48
48
  end
@@ -3,7 +3,7 @@ require 'shared/connection_examples'
3
3
 
4
4
  describe 'Zookeeper chrooted' do
5
5
  let(:path) { "/_zkchroottest_" }
6
- let(:data) { "underpants" }
6
+ let(:data) { "underpants" }
7
7
  let(:chroot_path) { '/slyphon-zookeeper-chroot' }
8
8
 
9
9
  let(:connection_string) { "#{Zookeeper.default_cnx_str}#{chroot_path}" }
@@ -35,8 +35,8 @@ describe 'Zookeeper chrooted' do
35
35
 
36
36
  it %[should successfully create the path] do
37
37
  rv = zk.create(:path => '/', :data => '')
38
- rv[:rc].should be_zero
39
- rv[:path].should == ''
38
+ expect(rv[:rc]).to be_zero
39
+ expect(rv[:path]).to eq('')
40
40
  end
41
41
  end
42
42
  end
@@ -53,8 +53,8 @@ describe 'Zookeeper chrooted' do
53
53
 
54
54
  it %[should return ZNONODE] do
55
55
  rv = zk.create(:path => '/', :data => '')
56
- rv[:rc].should_not be_zero
57
- rv[:rc].should == Zookeeper::Exceptions::ZNONODE
56
+ expect(rv[:rc]).not_to be_zero
57
+ expect(rv[:rc]).to eq(Zookeeper::Exceptions::ZNONODE)
58
58
  end
59
59
  end
60
60
  end
@@ -62,15 +62,15 @@ describe 'Zookeeper chrooted' do
62
62
 
63
63
 
64
64
  describe do
65
- before :all do
66
- logger.warn "running before :all"
65
+ before :each do
66
+ logger.warn "running before :each"
67
67
 
68
68
  with_open_zk do |z|
69
69
  z.create(:path => chroot_path, :data => '')
70
70
  end
71
71
  end
72
72
 
73
- after :all do
73
+ after :each do
74
74
  with_open_zk do |z|
75
75
  rm_rf(z, chroot_path)
76
76
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe 'Compatibiliy layer' do
4
4
  it %[should raise the correct error when a const is missing] do
5
- lambda { Zookeeper::THISISANINVALIDCONST }.should raise_error(NameError)
5
+ expect { Zookeeper::THISISANINVALIDCONST }.to raise_error(NameError)
6
6
  end
7
7
  end
8
8
 
@@ -4,7 +4,7 @@ describe Zookeeper do
4
4
  describe :initialize, 'with watcher block' do
5
5
  before do
6
6
  @events = []
7
- @watch_block = lambda do |hash|
7
+ @watch_block = lambda do |hash|
8
8
  logger.debug "watch_block: #{hash.inspect}"
9
9
  @events << hash
10
10
  end
@@ -12,7 +12,7 @@ describe Zookeeper do
12
12
  @zk = Zookeeper.new(Zookeeper.default_cnx_str, 10, @watch_block)
13
13
 
14
14
  wait_until(2) { @zk.connected? }
15
- @zk.should be_connected
15
+ expect(@zk).to be_connected
16
16
  logger.debug "connected!"
17
17
 
18
18
  wait_until(2) { !@events.empty? }
@@ -24,9 +24,9 @@ describe Zookeeper do
24
24
  end
25
25
 
26
26
  it %[should receive initial connection state events] do
27
- @events.should_not be_empty
28
- @events.length.should == 1
29
- @events.first[:state].should == Zookeeper::ZOO_CONNECTED_STATE
27
+ expect(@events).not_to be_empty
28
+ expect(@events.length).to eq(1)
29
+ expect(@events.first[:state]).to eq(Zookeeper::ZOO_CONNECTED_STATE)
30
30
  end
31
31
 
32
32
  it %[should receive disconnection events] do
@@ -34,7 +34,7 @@ describe Zookeeper do
34
34
  @events.clear
35
35
  @zk.close
36
36
  wait_until(2) { !@events.empty? }
37
- @events.should_not be_empty
37
+ expect(@events).not_to be_empty
38
38
  end
39
39
  end
40
40
  end
data/spec/em_spec.rb CHANGED
@@ -20,7 +20,7 @@ describe 'ZookeeperEM' do
20
20
  end
21
21
 
22
22
  def teardown_and_done
23
- @zk.close do
23
+ @zk.close do
24
24
  logger.debug { "TEST: about to call done" }
25
25
  EM.next_tick do
26
26
  done
@@ -31,7 +31,7 @@ describe 'ZookeeperEM' do
31
31
  describe 'callbacks' do
32
32
  it %[should be called on the reactor thread] do
33
33
  cb = lambda do |h|
34
- EM.reactor_thread?.should be_true
34
+ expect(EM.reactor_thread?).to be_truthy
35
35
  logger.debug { "called back on the reactor thread? #{EM.reactor_thread?}" }
36
36
  teardown_and_done
37
37
  end
@@ -39,7 +39,7 @@ describe 'ZookeeperEM' do
39
39
  setup_zk do
40
40
  @zk.on_attached do |*|
41
41
  logger.debug { "on_attached called" }
42
- rv = @zk.get(:path => '/', :callback => cb)
42
+ rv = @zk.get(:path => '/', :callback => cb)
43
43
  logger.debug { "rv from @zk.get: #{rv.inspect}" }
44
44
  end
45
45
  end
@@ -11,7 +11,7 @@ unless defined?(::JRUBY_VERSION)
11
11
  end
12
12
 
13
13
  it %[should have an original_pid assigned] do
14
- @zk.original_pid.should == Process.pid
14
+ expect(@zk.original_pid).to eq(Process.pid)
15
15
  end
16
16
  end
17
17
  end
@@ -112,11 +112,11 @@ unless defined?(::JRUBY_VERSION)
112
112
  status = wait_for_child_safely(@pid)
113
113
  raise "Child process did not exit, likely hung" unless status
114
114
 
115
- status.should_not be_signaled
116
- status.should be_success
115
+ expect(status).not_to be_signaled
116
+ expect(status).to be_success
117
117
 
118
- event_waiter_th.join(5).should == event_waiter_th
119
- @event.should_not be_nil
118
+ expect(event_waiter_th.join(5)).to eq(event_waiter_th)
119
+ expect(@event).not_to be_nil
120
120
  end
121
121
  end
122
122
  end
data/spec/latch_spec.rb CHANGED
@@ -16,7 +16,7 @@ describe Zookeeper::Latch do
16
16
  end
17
17
 
18
18
  other_latch.await
19
- th.join(1).should == th
19
+ expect(th.join(1)).to eq(th)
20
20
  end
21
21
  end
22
22
  end
@@ -1,10 +1,10 @@
1
1
  shared_examples_for "all success return values" do
2
2
  it %[should have a return code of Zookeeper::ZOK] do
3
- @rv[:rc].should == Zookeeper::ZOK
3
+ expect(@rv[:rc]).to eq(Zookeeper::ZOK)
4
4
  end
5
5
 
6
6
  it %[should have a req_id integer] do
7
- @rv[:req_id].should be_kind_of(Integer)
7
+ expect(@rv[:req_id]).to be_kind_of(Integer)
8
8
  end
9
9
  end
10
10