Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
laguage: ruby

before_install:
- spec/setup_kafka.sh

env: KAFKA_PATH=./spec/kafka/

script: ./script/cibuild

rvm:
- 1.9.3
- 2.0.0
Expand All @@ -10,4 +18,5 @@ rvm:
matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
- rvm: rbx-19mode
2 changes: 2 additions & 0 deletions lib/poseidon/partition_consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def fetch(options = {})
end

topic_fetches = build_topic_fetch_request(fetch_max_bytes)
p "PRE FETCH: #{Time.now.to_i}"
fetch_response = @connection.fetch(fetch_max_wait, fetch_min_bytes, topic_fetches)
p "POST FETCH: #{Time.now.to_i}"
topic_response = fetch_response.topic_fetch_responses.first
partition_response = topic_response.partition_fetch_responses.first

Expand Down
2 changes: 2 additions & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
bundle exec rake spec:all
2 changes: 1 addition & 1 deletion spec/integration/simple/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
JavaRunner.set_kafka_path!
$tc = TestCluster.new
$tc.start
sleep 5
sleep 10
end

config.after(:each) do
Expand Down
8 changes: 8 additions & 0 deletions spec/setup_kafka.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

cd spec/

git clone https://github.com/apache/kafka.git
cd kafka
git checkout 0.8.1
./gradlew -q jar
5 changes: 3 additions & 2 deletions spec/test_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ def stop
if !@stopped
killed_at = Time.now
loop do
puts `ps ax | grep java`
if (pid = `#{@pid_cmd}`.to_i) == 0
SPEC_LOGGER.info "Killed."
break
end

if Time.now - killed_at > 30
if Time.now - killed_at > 60
raise "Failed to kill process!"
end

Expand Down Expand Up @@ -94,7 +95,7 @@ def without_process

def run
FileUtils.mkdir_p(log_dir)
`LOG_DIR=#{log_dir} #{@start_cmd} #{config_path}`
system( { "LOG_DIR" => log_dir }, "#{@start_cmd} #{config_path}")
@stopped = false
end

Expand Down