Skip to content

Commit 06086b7

Browse files
committed
Remove test that busy_timeout holds GVL
1 parent 4a1a650 commit 06086b7

1 file changed

Lines changed: 2 additions & 41 deletions

File tree

test/test_integration_pending.rb

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -80,44 +80,6 @@ def test_busy_timeout
8080
assert time.real*1000 >= 1000
8181
end
8282

83-
def test_busy_timeout_holds_gvl
84-
work = []
85-
Thread.new do
86-
while true
87-
sleep 0.1
88-
work << '.'
89-
end
90-
end
91-
sleep 1
92-
93-
@db.busy_timeout 1000
94-
busy = Mutex.new
95-
busy.lock
96-
97-
t = Thread.new do
98-
begin
99-
db2 = SQLite3::Database.open( "test.db" )
100-
db2.transaction( :exclusive ) do
101-
busy.lock
102-
end
103-
ensure
104-
db2.close if db2
105-
end
106-
end
107-
sleep 1
108-
109-
assert_raises( SQLite3::BusyException ) do
110-
work << '>'
111-
@db.execute "insert into foo (b) values ( 'from 2' )"
112-
end
113-
114-
busy.unlock
115-
t.join
116-
117-
p ['busy_timeout', work]
118-
assert 2 >= work.size - work.find_index(">")
119-
end
120-
12183
def test_busy_handler_timeout_releases_gvl
12284
work = []
12385

@@ -155,14 +117,13 @@ def test_busy_handler_timeout_releases_gvl
155117
sleep 1
156118

157119
assert_raises( SQLite3::BusyException ) do
158-
work << '>'
120+
work << '|'
159121
@db.execute "insert into foo (b) values ( 'from 2' )"
160122
end
161123

162124
busy.unlock
163125
t.join
164126

165-
p ['busy_handler_timeout', work]
166-
assert 2 < work.size - work.find_index(">")
127+
assert work.size - work.find_index('|') > 3
167128
end
168129
end

0 commit comments

Comments
 (0)