Skip to content

Commit aaa4869

Browse files
committed
skip test with ruby-asan
1 parent 099fd5c commit aaa4869

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

test/duckdb_test/appender_test.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ def test_s_new_with_schema
4949
@con.execute('CREATE SCHEMA a; CREATE TABLE a.b (id INT);')
5050
appender = DuckDB::Appender.new(@con, 'a', 'b')
5151
assert_instance_of(DuckDB::Appender, appender)
52+
end
5253

53-
assert_raises(DuckDB::Error) { appender = DuckDB::Appender.new(@con, 'b', 'b') }
54+
def test_s_new_with_invalid_schema
55+
skip('test with ASAN') if ENV['ASAN_TEST'] == '1'
56+
@con.execute('CREATE SCHEMA a; CREATE TABLE a.b (id INT);')
57+
assert_raises(DuckDB::Error) { DuckDB::Appender.new(@con, 'b', 'b') }
5458
end
5559

5660
def sub_test_append_column2(method, type, values:, expected:)
@@ -133,6 +137,7 @@ def test_close
133137
end
134138

135139
def test_close_with_exception
140+
skip 'test with ASAN' if ENV['ASAN_TEST'] == '1'
136141
appender = create_appender('col BOOLEAN NOT NULL')
137142
appender
138143
.append_null

test/duckdb_test/config_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_set_config_with_exception
5353
end
5454

5555
def test_set_invalid_option
56+
skip 'test with ASAN' if ENV['ASAN_TEST'] == '1'
5657
config = DuckDB::Config.new
5758
assert_instance_of(DuckDB::Config, config.set_config('aaa_invalid_option', 'READ_ONLY'))
5859
assert_raises(DuckDB::Error) do

test/duckdb_test/connection_test.rb

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,22 @@ def test_query_with_valid_hash_params
3535
assert_equal('a', r.each.first[1])
3636
end
3737

38-
def test_query_with_invalid_params
39-
assert_raises(DuckDB::Error) { @con.query('foo', 'bar') }
40-
41-
assert_raises(ArgumentError) { @con.query }
42-
43-
assert_raises(TypeError) { @con.query(1) }
38+
def test_query_with_invalid_params_and_raise_duckdb_error
39+
skip 'test with ASAN' if ENV['ASAN_TEST'] == '1'
4440

41+
assert_raises(DuckDB::Error) { @con.query('foo', 'bar') }
4542
assert_raises(DuckDB::Error) do
4643
invalid_sql = 'CREATE TABLE table1 ('
4744
@con.query(invalid_sql)
4845
end
4946
end
5047

48+
def test_query_with_invalid_params
49+
assert_raises(ArgumentError) { @con.query }
50+
51+
assert_raises(TypeError) { @con.query(1) }
52+
end
53+
5154
def test_async_query
5255
pending_result = @con.async_query('CREATE TABLE table1 (id INTEGER)')
5356
assert_instance_of(DuckDB::PendingResult, pending_result)
@@ -79,6 +82,7 @@ def test_async_query_with_valid_hash_params
7982
end
8083

8184
def test_async_query_with_invalid_params
85+
skip 'test with ASAN' if ENV['ASAN_TEST'] == '1'
8286
assert_raises(DuckDB::Error) { @con.async_query('foo', 'bar') }
8387

8488
assert_raises(ArgumentError) { @con.async_query }
@@ -178,11 +182,15 @@ def test_query_progress
178182
"QueryProgress: total_rows_to_process(#{total_rows_to_process}) to be >= rows_processed(#{rows_processed})"
179183
)
180184

181-
# test interrupt
182-
@con.interrupt
183-
while pending_result.state == :not_ready
184-
pending_result.execute_task
185-
assert(pending_result.state != :ready, 'pending_result.state should not be :ready')
185+
if ENV['ASAN_TEST'].nil?
186+
# test interrupt
187+
@con.interrupt
188+
while pending_result.state == :not_ready
189+
pending_result.execute_task
190+
assert(pending_result.state != :ready, 'pending_result.state should not be :ready')
191+
end
192+
else
193+
skip 'test with ASAN'
186194
end
187195
end
188196

test/duckdb_test/database_test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ def test_s_open_argument
3030

3131
assert_raises(TypeError) { DuckDB::Database.open('foo', 'bar') }
3232
assert_raises(TypeError) { DuckDB::Database.open(1) }
33+
end
3334

35+
def test_s_open_invalid_argument
36+
skip('test with ASAN') if ENV['ASAN_TEST'] == '1'
3437
assert_raises(DuckDB::Error) do
3538
not_exist_path = "#{create_path}/#{create_path}"
3639
DuckDB::Database.open(not_exist_path)

test/duckdb_test/prepared_statement_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ def test_s_new
102102
assert_raises(ArgumentError) { DuckDB::PreparedStatement.new }
103103
assert_raises(TypeError) { DuckDB::PreparedStatement.new(@con, 1) }
104104
assert_raises(TypeError) { DuckDB::PreparedStatement.new(1, 1) }
105+
end
106+
107+
def test_s_new_with_duckdb_error
108+
skip 'test with ASAN' if ENV['ASAN_TEST'] == '1'
105109
assert_raises(DuckDB::Error) { DuckDB::PreparedStatement.new(@con, 'SELECT * FROM') }
106110
end
107111

@@ -153,6 +157,7 @@ def test_param_type
153157
end
154158

155159
def test_clear_bindings
160+
skip 'test with ASAN' if ENV['ASAN_TEST'] == '1'
156161
stmt = DuckDB::PreparedStatement.new(@con, 'SELECT * FROM a WHERE id = $1')
157162
stmt.bind(1, 1)
158163
stmt.clear_bindings
@@ -447,6 +452,7 @@ def test_bind_varchar_timestamp
447452
end
448453

449454
def test_bind_varchar_timestamp_with_invalid_timestamp_string
455+
skip 'test with ASAN' if ENV['ASAN_TEST'] == '1'
450456
stmt = DuckDB::PreparedStatement.new(@con, 'SELECT * FROM a WHERE col_timestamp = $1')
451457

452458
stmt.bind_varchar(1, 'invalid_timestamp_string')

0 commit comments

Comments
 (0)