Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use GA #288

Merged
merged 1 commit into from Nov 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/actions.yml
@@ -0,0 +1,23 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql
strategy:
matrix:
ruby: [ '2.5', '2.6', '2.7' ]
name: ${{ matrix.ruby }} rake ${{ matrix.task }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rake
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

56 changes: 27 additions & 29 deletions spec/cases/map_with_ar.rb
@@ -1,45 +1,43 @@
require './spec/cases/helper'
require "active_record"

Tempfile.open("xxx") do |f|
database = "parallel_with_ar_test"
`mysql #{database} -e '' || mysql -e 'create database #{database}'`
database = "parallel_with_ar_test"
`mysql #{database} -e '' || mysql -e 'create database #{database}'`

ActiveRecord::Schema.verbose = false
ActiveRecord::Base.establish_connection(
:adapter => "mysql2",
:database => database
)
ActiveRecord::Schema.verbose = false
ActiveRecord::Base.establish_connection(
:adapter => "mysql2",
:database => database
)

class User < ActiveRecord::Base
end
class User < ActiveRecord::Base
end

# create tables
unless User.table_exists?
ActiveRecord::Schema.define(:version => 1) do
create_table :users do |t|
t.string :name
end
# create tables
unless User.table_exists?
ActiveRecord::Schema.define(:version => 1) do
create_table :users do |t|
t.string :name
end
end
end

User.delete_all
User.delete_all

User.create!(:name => "X")
User.create!(:name => "X")

Parallel.map(1..8) do |i|
User.create!(:name => i)
end
Parallel.map(1..8) do |i|
User.create!(:name => i)
end

puts "User.count: #{User.count}"
puts "User.count: #{User.count}"

puts User.connection.reconnect!.inspect
puts User.connection.reconnect!.inspect

Parallel.map(1..8, :in_threads => 4) do |i|
User.create!(:name => i)
end
Parallel.map(1..8, :in_threads => 4) do |i|
User.create!(:name => i)
end

User.create!(:name => "X")
User.create!(:name => "X")

puts User.all.map(&:name).sort.join("-")
end
puts User.all.map(&:name).sort.join("-")
2 changes: 1 addition & 1 deletion spec/parallel_spec.rb
Expand Up @@ -189,7 +189,7 @@ def cpus
end

it "does not open unnecessary pipes" do
max = (RbConfig::CONFIG["target_os"].include?("darwin1") ? 10 : 1500) # somehow super bad on travis
max = (RbConfig::CONFIG["target_os"].include?("darwin1") ? 10 : 1800) # somehow super bad on CI
`ruby spec/cases/count_open_pipes.rb`.to_i.should < max
end
end
Expand Down