From 912420f5a31aeb13e9180a5dab8bed45d8d62a25 Mon Sep 17 00:00:00 2001 From: Bob Potter Date: Wed, 16 Jul 2014 18:11:44 -0500 Subject: [PATCH 1/8] Run integration specs on travis-ci --- .travis.yml | 6 ++++++ script/cibuild | 2 ++ spec/setup_kafka.sh | 8 ++++++++ 3 files changed, 16 insertions(+) create mode 100755 script/cibuild create mode 100755 spec/setup_kafka.sh diff --git a/.travis.yml b/.travis.yml index 025a5e0..cc4c2ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,10 @@ laguage: ruby + +before_install: + - spec/setup_kafka.sh + +script: ./script/cibuild + rvm: - 1.9.3 - 2.0.0 diff --git a/script/cibuild b/script/cibuild new file mode 100755 index 0000000..cd0a497 --- /dev/null +++ b/script/cibuild @@ -0,0 +1,2 @@ +#!/bin/sh +bundle exec rake spec:all diff --git a/spec/setup_kafka.sh b/spec/setup_kafka.sh new file mode 100755 index 0000000..3be6612 --- /dev/null +++ b/spec/setup_kafka.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +cd spec/ + +git clone https://github.com/apache/kafka.git +cd kafka +git checkout 0.8.1 +./gradelw jar From 173ed966e7221310053a0bec2da915193a27043a Mon Sep 17 00:00:00 2001 From: Bob Potter Date: Fri, 18 Jul 2014 13:07:40 -0500 Subject: [PATCH 2/8] Fix typo --- spec/setup_kafka.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/setup_kafka.sh b/spec/setup_kafka.sh index 3be6612..0df3d5e 100755 --- a/spec/setup_kafka.sh +++ b/spec/setup_kafka.sh @@ -5,4 +5,4 @@ cd spec/ git clone https://github.com/apache/kafka.git cd kafka git checkout 0.8.1 -./gradelw jar +./gradlew jar From f0c9ffa9642d30ccf0bd91fc31c0fefea0e72c73 Mon Sep 17 00:00:00 2001 From: Bob Potter Date: Fri, 18 Jul 2014 13:21:06 -0500 Subject: [PATCH 3/8] Set kafka path --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index cc4c2ec..2519ce3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ laguage: ruby before_install: - spec/setup_kafka.sh +env: KAFKA_PATH=./spec/kafka/ + script: ./script/cibuild rvm: From 3034e2d66e920f4fb449a89182fd4d1b0a4073e4 Mon Sep 17 00:00:00 2001 From: Bob Potter Date: Fri, 18 Jul 2014 13:52:38 -0500 Subject: [PATCH 4/8] Make gradlew quiet --- spec/setup_kafka.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/setup_kafka.sh b/spec/setup_kafka.sh index 0df3d5e..cf30628 100755 --- a/spec/setup_kafka.sh +++ b/spec/setup_kafka.sh @@ -5,4 +5,4 @@ cd spec/ git clone https://github.com/apache/kafka.git cd kafka git checkout 0.8.1 -./gradlew jar +./gradlew -q jar From f369eb0aae17733bd231de4ce52ef8099370f5f7 Mon Sep 17 00:00:00 2001 From: Bob Potter Date: Fri, 18 Jul 2014 13:57:34 -0500 Subject: [PATCH 5/8] Properly set environment variable --- spec/test_cluster.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/test_cluster.rb b/spec/test_cluster.rb index 8915629..ab6788c 100644 --- a/spec/test_cluster.rb +++ b/spec/test_cluster.rb @@ -94,7 +94,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 From fa6e263a800772e1b02262250d77f283ea7492d8 Mon Sep 17 00:00:00 2001 From: Bob Potter Date: Fri, 18 Jul 2014 16:05:06 -0500 Subject: [PATCH 6/8] Sup yo --- lib/poseidon/partition_consumer.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/poseidon/partition_consumer.rb b/lib/poseidon/partition_consumer.rb index a81b69c..7d72019 100644 --- a/lib/poseidon/partition_consumer.rb +++ b/lib/poseidon/partition_consumer.rb @@ -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 From 3acd291444f61fff6727772d814f468b45a111ec Mon Sep 17 00:00:00 2001 From: Bob Potter Date: Mon, 21 Jul 2014 16:54:46 -0500 Subject: [PATCH 7/8] Increase graceperiodish --- spec/integration/simple/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/simple/spec_helper.rb b/spec/integration/simple/spec_helper.rb index 5884122..fa2f388 100644 --- a/spec/integration/simple/spec_helper.rb +++ b/spec/integration/simple/spec_helper.rb @@ -8,7 +8,7 @@ JavaRunner.set_kafka_path! $tc = TestCluster.new $tc.start - sleep 5 + sleep 10 end config.after(:each) do From 6f2d1f717e71924ece109cc07d3e8ffef257482c Mon Sep 17 00:00:00 2001 From: Bob Potter Date: Mon, 28 Jul 2014 11:16:49 -0500 Subject: [PATCH 8/8] Tweak --- .travis.yml | 1 + spec/test_cluster.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2519ce3..c62af08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,4 +18,5 @@ rvm: matrix: allow_failures: - rvm: ruby-head + - rvm: jruby-head - rvm: rbx-19mode diff --git a/spec/test_cluster.rb b/spec/test_cluster.rb index ab6788c..e2f0393 100644 --- a/spec/test_cluster.rb +++ b/spec/test_cluster.rb @@ -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