grntest 1.4.9 → 1.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e027a36e3f3e1206e89cf0cc617a5e892074bd207ee46f29ebccf9b68bf25bc0
4
- data.tar.gz: 4393ff236546341e6abba56083164ed4bdd51564a3acc0b3087ac2bf1cc6fec1
3
+ metadata.gz: 81a6e6ccd33fb04aa9ea645a09c3cb0afc2ed8222af2960b4a64f791f43ea6a5
4
+ data.tar.gz: 7bbed9cb728ff29ab820eab0b0c1faa03fedd85bd2bce31751d793131f7c5a8e
5
5
  SHA512:
6
- metadata.gz: 14748646fa504319011a9cd649c732ae644ef2b7ec73a402f9740dda5a0f125e38dba7b227a4873766cc31777daf5d9407e9ab7ea5dd328f20eb858474c9a028
7
- data.tar.gz: f34f315596201dec45cc177bfd0edba7f40f3dede8c6d8a046a28cf85fabf47ef1703340bc6008c60c751eda5712e38ea3bb0e52447118556536a93804a6a817
6
+ metadata.gz: 3550c1df4e2bacc1a98de32178542a22bd5ffe9abd96724384205254c83d934d5dfaabf8bc11666c33f84b8fad5a2a6de787fe7ff8d8ab3874a1632bf2139f56
7
+ data.tar.gz: d90a67aff31962a27fe0e7a1cdd87381d058311af47a9d70e0b6bee8f86e33b38534289b87d253bc4edb639543e388757537b7151c18389f3143c13d110ff6df
data/doc/text/news.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # News
2
2
 
3
+ ## 1.5.3: 2021-08-14
4
+
5
+ ### Improvements
6
+
7
+ * `generate-series`: Added support for multi-byte characters.
8
+
9
+ ## 1.5.2: 2021-08-05
10
+
11
+ ### Improvements
12
+
13
+ * `stdio`: Improved may be slow command processing.
14
+
15
+ * `copy-path`: Handled error.
16
+
17
+ * `generate-series`: Improved multi threading support.
18
+
19
+ ## 1.5.1: 2021-07-16
20
+
21
+ ### Improvements
22
+
23
+ * `http`: Improved response check.
24
+
25
+ ## 1.5.0: 2021-07-16
26
+
27
+ ### Improvements
28
+
29
+ * `http`: Added response code check.
30
+
31
+ * `groonga-httpd`: Increased the max body size.
32
+
3
33
  ## 1.4.9: 2021-07-12
4
34
 
5
35
  ### Improvements
@@ -180,7 +180,14 @@ module Grntest
180
180
  end
181
181
  source = resolve_path(Pathname(expand_variables(source)))
182
182
  destination = resolve_path(Pathname(expand_variables(destination)))
183
- FileUtils.cp_r(source.to_s, destination.to_s)
183
+ begin
184
+ FileUtils.cp_r(source.to_s, destination.to_s)
185
+ rescue SystemCallError => error
186
+ log_input(line)
187
+ details = "#{error.class}: #{error.message}"
188
+ log_error("#|e| [copy-path] failed to copy: #{details}")
189
+ @context.error
190
+ end
184
191
  end
185
192
 
186
193
  def timeout_value(key, line, input, default)
@@ -299,7 +306,7 @@ module Grntest
299
306
 
300
307
  def execute_directive_generate_series(parser, line, content, options)
301
308
  start, stop, table, template, = options
302
- evaluator = TemplateEvaluator.new(template)
309
+ evaluator = TemplateEvaluator.new(template.force_encoding("UTF-8"))
303
310
  (Integer(start)..Integer(stop)).each_slice(1000) do |range|
304
311
  parser << "load --table #{table}\n"
305
312
  parser << "["
@@ -313,7 +320,10 @@ module Grntest
313
320
  end
314
321
  record << "\n"
315
322
  record << evaluator.evaluate(i).to_json
323
+ before = Time.now
316
324
  parser << record
325
+ elapsed = Time.now - before
326
+ Thread.pass if elapsed > 1.0
317
327
  end
318
328
  parser << "\n]\n"
319
329
  end
@@ -78,6 +78,18 @@ module Grntest
78
78
  DEBUG = (ENV["GRNTEST_HTTP_DEBUG"] == "yes")
79
79
  LOAD_DEBUG = (DEBUG or (ENV["GRNTEST_HTTP_LOAD_DEBUG"] == "yes"))
80
80
 
81
+ def check_response(response)
82
+ case response
83
+ when Net::HTTPBadRequest,
84
+ Net::HTTPNotFound
85
+ # Groonga returns them for an invalid request.
86
+ when Net::HTTPInternalServerError
87
+ # Groonga returns this for an internal error.
88
+ else
89
+ response.value
90
+ end
91
+ end
92
+
81
93
  MAX_URI_SIZE = 4096
82
94
  def send_load_command(command)
83
95
  lines = command.original_source.lines
@@ -122,6 +134,7 @@ module Grntest
122
134
  http.read_timeout = read_timeout
123
135
  http.request(request)
124
136
  end
137
+ check_response(response)
125
138
  normalize_response_data(command, response.body)
126
139
  end
127
140
  end
@@ -144,6 +157,7 @@ module Grntest
144
157
  http.read_timeout = read_timeout
145
158
  http.request(request)
146
159
  end
160
+ check_response(response)
147
161
  normalize_response_data(command, response.body)
148
162
  end
149
163
  end
@@ -174,6 +188,10 @@ module Grntest
174
188
  message = "bad HTTP header syntax in Groonga response: <#{url}>: "
175
189
  message << "#{$!.class}: #{$!.message}"
176
190
  raise Error.new(message)
191
+ rescue Net::HTTPServerException
192
+ message = "exception from Groonga: <#{url}>: "
193
+ message << "#{$!.class}: #{$!.message}"
194
+ raise Error.new(message)
177
195
  end
178
196
  end
179
197
 
@@ -65,10 +65,12 @@ module Grntest
65
65
 
66
66
  MAY_SLOW_COMMANDS = [
67
67
  "column_create",
68
+ "delete",
68
69
  "load",
69
70
  "logical_table_remove",
70
71
  "plugin_register",
71
72
  "register",
73
+ "wal_recover",
72
74
  ]
73
75
  def may_slow_command?(command)
74
76
  MAY_SLOW_COMMANDS.include?(command.name)
@@ -545,6 +545,7 @@ http {
545
545
  groonga_log_path #{context.log_path};
546
546
  groonga_query_log_path #{context.query_log_path};
547
547
  groonga on;
548
+ client_max_body_size 500m;
548
549
  }
549
550
  }
550
551
  }
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2020 Sutou Kouhei <kou@clear-code.com>
1
+ # Copyright (C) 2012-2021 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # This program is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Grntest
17
- VERSION = "1.4.9"
17
+ VERSION = "1.5.3"
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grntest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.9
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-12 00:00:00.000000000 Z
12
+ date: 2021-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs