serverengine 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/linux.yml +26 -0
- data/Changelog +4 -0
- data/NOTICE +1 -1
- data/appveyor.yml +24 -13
- data/lib/serverengine/version.rb +1 -1
- data/lib/serverengine/winsock.rb +14 -1
- data/spec/blocking_flag_spec.rb +16 -4
- data/spec/server_worker_context.rb +1 -1
- data/spec/supervisor_spec.rb +1 -1
- data/spec/winsock_spec.rb +18 -0
- metadata +6 -4
- data/.travis.yml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f04e7c4dc99fb0496568579a6516ac6df8bdae3d5c8927aa9586ff3fa530876d
|
4
|
+
data.tar.gz: fcdc7828debe292af0950c9f3d3c8947c05733d3e338449667fe4b057e425c5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dc366572a0df514840c8e5f74bacf1d801f86f402de15c125006d332e256be1239e91991ce02aaad82be9b0ec45eb0305c7792e39b1d666edb674671c533761
|
7
|
+
data.tar.gz: c45dd0d66fe2c55e9cb71bdf930db49f33abcd08d14071aa5bb130d0119e1828691c2d6aab9372538c24b3d784dee767c625f7b2348cd03b525b1338970a32c3
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: Testing on Ubuntu
|
2
|
+
on:
|
3
|
+
- push
|
4
|
+
- pull_request
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ${{ matrix.os }}
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
12
|
+
os:
|
13
|
+
- ubuntu-latest
|
14
|
+
name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v2
|
17
|
+
- uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ${{ matrix.ruby }}
|
20
|
+
- name: unit testing
|
21
|
+
env:
|
22
|
+
CI: true
|
23
|
+
run: |
|
24
|
+
gem install bundler rake
|
25
|
+
bundle install --jobs 4 --retry 3
|
26
|
+
bundle exec rake spec
|
data/Changelog
CHANGED
data/NOTICE
CHANGED
data/appveyor.yml
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
---
|
2
|
+
image: Visual Studio 2019
|
3
|
+
|
2
4
|
install:
|
3
5
|
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
4
6
|
- ruby --version
|
@@ -6,19 +8,28 @@ install:
|
|
6
8
|
- bundle install
|
7
9
|
build: off
|
8
10
|
test_script:
|
9
|
-
- bundle exec rake
|
11
|
+
- bundle exec rake spec
|
10
12
|
|
11
13
|
environment:
|
12
14
|
matrix:
|
13
|
-
- ruby_version: "
|
14
|
-
|
15
|
-
- ruby_version: "
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
- ruby_version: "30-x64"
|
16
|
+
- ruby_version: "27-x64"
|
17
|
+
- ruby_version: "26-x64"
|
18
|
+
- ruby_version: "25-x64"
|
19
|
+
|
20
|
+
# On Ruby 3.0, we need to use fiddle 1.0.8 or later to retrieve correct
|
21
|
+
# error code. In addition, we have to specify the path of fiddle by RUBYLIB
|
22
|
+
# because RubyInstaller loads Ruby's bundled fiddle before initializing gem.
|
23
|
+
# See also:
|
24
|
+
# * https://github.com/ruby/fiddle/issues/72
|
25
|
+
# * https://bugs.ruby-lang.org/issues/17813
|
26
|
+
# * https://github.com/oneclick/rubyinstaller2/blob/8225034c22152d8195bc0aabc42a956c79d6c712/lib/ruby_installer/build/dll_directory.rb
|
27
|
+
for:
|
28
|
+
-
|
29
|
+
matrix:
|
30
|
+
only:
|
31
|
+
- ruby_version: "30-x64"
|
32
|
+
test_script:
|
33
|
+
- gem install fiddle --version 1.0.8
|
34
|
+
- set RUBYLIB=C:/Ruby%ruby_version%/lib/ruby/gems/3.0.0/gems/fiddle-1.0.8/lib
|
35
|
+
- bundle exec rake spec
|
data/lib/serverengine/version.rb
CHANGED
data/lib/serverengine/winsock.rb
CHANGED
@@ -78,6 +78,19 @@ module ServerEngine
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
def self.last_error
|
82
|
+
# On Ruby 3.0 calling WSAGetLastError here can't retrieve correct error
|
83
|
+
# code because Ruby's internal code resets it.
|
84
|
+
# See also:
|
85
|
+
# * https://github.com/ruby/fiddle/issues/72
|
86
|
+
# * https://bugs.ruby-lang.org/issues/17813
|
87
|
+
if Fiddle.respond_to?(:win32_last_socket_error)
|
88
|
+
Fiddle.win32_last_socket_error || 0
|
89
|
+
else
|
90
|
+
self.WSAGetLastError
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
81
94
|
INVALID_SOCKET = -1
|
82
95
|
end
|
83
96
|
|
@@ -99,7 +112,7 @@ module ServerEngine
|
|
99
112
|
extern "int rb_w32_map_errno(int)"
|
100
113
|
|
101
114
|
def self.raise_last_error(name)
|
102
|
-
errno = rb_w32_map_errno(WinSock.
|
115
|
+
errno = rb_w32_map_errno(WinSock.last_error)
|
103
116
|
raise SystemCallError.new(name, errno)
|
104
117
|
end
|
105
118
|
|
data/spec/blocking_flag_spec.rb
CHANGED
@@ -20,10 +20,16 @@ describe ServerEngine::BlockingFlag do
|
|
20
20
|
it 'wait_for_set timeout' do
|
21
21
|
start = Time.now
|
22
22
|
|
23
|
-
subject.wait_for_set(0.
|
23
|
+
subject.wait_for_set(0.1)
|
24
24
|
elapsed = Time.now - start
|
25
25
|
|
26
|
-
|
26
|
+
if ServerEngine.windows? && ENV['CI'] == 'True'
|
27
|
+
# timer seems low accuracy on Windows CI container, often a bit shorter
|
28
|
+
# than expected
|
29
|
+
elapsed.should >= 0.1 * 0.95
|
30
|
+
else
|
31
|
+
elapsed.should >= 0.1
|
32
|
+
end
|
27
33
|
end
|
28
34
|
|
29
35
|
it 'wait_for_reset timeout' do
|
@@ -31,10 +37,16 @@ describe ServerEngine::BlockingFlag do
|
|
31
37
|
|
32
38
|
start = Time.now
|
33
39
|
|
34
|
-
subject.wait_for_reset(0.
|
40
|
+
subject.wait_for_reset(0.1)
|
35
41
|
elapsed = Time.now - start
|
36
42
|
|
37
|
-
|
43
|
+
if ServerEngine.windows? && ENV['CI'] == 'True'
|
44
|
+
# timer seems low accuracy on Windows CI container, often a bit shorter
|
45
|
+
# than expected
|
46
|
+
elapsed.should >= 0.1 * 0.95
|
47
|
+
else
|
48
|
+
elapsed.should >= 0.1
|
49
|
+
end
|
38
50
|
end
|
39
51
|
|
40
52
|
it 'wait' do
|
data/spec/supervisor_spec.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'windows/error' if ServerEngine.windows?
|
2
|
+
|
3
|
+
describe ServerEngine::WinSock do
|
4
|
+
# On Ruby 3.0, you need to use fiddle 1.0.8 or later to retrieve a correct
|
5
|
+
# error code. In addition, you need to specify the path of fiddle by RUBYLIB
|
6
|
+
# or `ruby -I` when you use RubyInstaller because it loads Ruby's bundled
|
7
|
+
# fiddle before initializing gem.
|
8
|
+
# See also:
|
9
|
+
# * https://github.com/ruby/fiddle/issues/72
|
10
|
+
# * https://bugs.ruby-lang.org/issues/17813
|
11
|
+
# * https://github.com/oneclick/rubyinstaller2/blob/8225034c22152d8195bc0aabc42a956c79d6c712/lib/ruby_installer/build/dll_directory.rb
|
12
|
+
context 'last_error' do
|
13
|
+
it 'bind error' do
|
14
|
+
expect(WinSock.bind(0, nil, 0)).to be -1
|
15
|
+
expect(WinSock.last_error).to be Windows::Error::WSAENOTSOCK
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end if ServerEngine.windows?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sigdump
|
@@ -87,9 +87,9 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/linux.yml"
|
90
91
|
- ".gitignore"
|
91
92
|
- ".rspec"
|
92
|
-
- ".travis.yml"
|
93
93
|
- Changelog
|
94
94
|
- Gemfile
|
95
95
|
- LICENSE
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- spec/socket_manager_spec.rb
|
135
135
|
- spec/spec_helper.rb
|
136
136
|
- spec/supervisor_spec.rb
|
137
|
+
- spec/winsock_spec.rb
|
137
138
|
homepage: https://github.com/fluent/serverengine
|
138
139
|
licenses:
|
139
140
|
- Apache 2.0
|
@@ -153,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
154
|
- !ruby/object:Gem::Version
|
154
155
|
version: '0'
|
155
156
|
requirements: []
|
156
|
-
rubygems_version: 3.
|
157
|
+
rubygems_version: 3.2.5
|
157
158
|
signing_key:
|
158
159
|
specification_version: 4
|
159
160
|
summary: ServerEngine - multiprocess server framework
|
@@ -168,3 +169,4 @@ test_files:
|
|
168
169
|
- spec/socket_manager_spec.rb
|
169
170
|
- spec/spec_helper.rb
|
170
171
|
- spec/supervisor_spec.rb
|
172
|
+
- spec/winsock_spec.rb
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
rvm:
|
4
|
-
- 2.4.9
|
5
|
-
- 2.5.7
|
6
|
-
- 2.6.5
|
7
|
-
- 2.7
|
8
|
-
- ruby-head
|
9
|
-
|
10
|
-
branches:
|
11
|
-
only:
|
12
|
-
- master
|
13
|
-
|
14
|
-
script: bundle exec rake spec
|
15
|
-
|
16
|
-
before_install:
|
17
|
-
- gem update bundler
|
18
|
-
|
19
|
-
matrix:
|
20
|
-
allow_failures:
|
21
|
-
- rvm: ruby-head
|