Comments (6)
Hey man, sorry for the delay. I've been traveling. Feq questions:
- are you using most recent karafka-testing of most recent for
1.3
? - did you try to upgrade to
1.4
? While I still support1.3
it's close to EOL. - do your specs run in multiple threads or anything are that?
- are you using some sort of thread storage that would be cleared with each spec running?
from karafka-testing.
Also have same issue.
- using karafka-testing 1.4.2, karafka 1.4.9, ruby-kafka 1.4.0
- No, very simple setup rspec setup.
- Not sure what this question means... Kinda very plain test. I am using VCR though.
Example of failing test
require_relative '../../karafka_app'
RSpec.describe RuleNotificationsConsumer, vcr: true do
# This will create a consumer instance with all the settings defined for the given topic
subject(:consumer) { karafka_consumer_for(:scheduled_rule_events) }
let(:app) { create(:app) }
let(:rule1_no_log) { create(:butler_rule, app: app) }
let(:rule2) { create(:butler_rule, :manual, app: app) }
let!(:log_rule_2) { create(:butler_rule_log, rule: rule2) }
let(:rule3) { create(:butler_rule, :manual, app: app) }
let!(:log_rule_3) { create(:butler_rule_log, rule: rule3) }
before do
# Sends messages to Karafka consumer
publish_for_karafka(encode(rule1_no_log.id, 'opened'))
publish_for_karafka(encode(rule2.id, 'opened'))
publish_for_karafka(encode(rule2.id, 'opened'))
publish_for_karafka(encode(rule2.id, 'errored'))
publish_for_karafka(encode(rule3.id, 'errored'))
publish_for_karafka(encode('nonexistent_id', 'errored'))
end
def avro
@avro ||= AvroRegistry.instance
end
def encode(rule_id, type)
avro.encode({
'rule_id' => rule_id,
'type' => type,
'timestamp' => Time.now
}, subject: 'scheduled_rule_event', version: 1)
end
it 'expects to log a proper message' do
consumer.consume
expect(log_rule_2.reload.opened_count).to eq 2
expect(log_rule_2.errored_count).to eq 1
expect(log_rule_3.reload.opened_count).to eq 0
expect(log_rule_3.errored_count).to eq 1
end
end
from karafka-testing.
@mib32 would you be willing to narrow it down to a reproduction repo? With this I could fix it in minutes. Otherwise I will have to do my best to replicate your gems setup, etc.
from karafka-testing.
@diogoleitao @mib32 I was able to reproduce. I will fix it today.
from karafka-testing.
ref #71 and moving to testing lib
from karafka-testing.
new karafka-testing has been released. it fixes this problem.
from karafka-testing.
Related Issues (20)
- Configuration testing HOT 10
- `certs/cert_chain.pem` permissions are wrong in the gem from rubygems HOT 3
- DLQ testing in rspec unit test cases HOT 5
- Do not use `described_class` to build consumer but instead use routing topic reference
- Dependency Dashboard
- have_enqueued_job rspec matcher does not work with :karafka ActiveJob queue_adapter HOT 3
- Retire the client stubs and replace them with alternative client after WaterDrop `2.6.0` release HOT 2
- NameError: uninitialized constant WaterDrop::Producer::DummyClient HOT 4
- Add support for client commit_offsets and commit_offsets! stubs
- Headers are not accumulated in the bufferred rspec tracker HOT 1
- Expand dummy client API with `#seek`
- karafka-testing 2.1.2 "consumer_for" helper, passed consumer_group not working. HOT 1
- Expand dummy api with `#used?`
- Make sure dummy producer supports transactions HOT 1
- Support for testing around pattern matching in topic to consumer mapping HOT 3
- Same CG multiplexing topic builder fails with TopicInManyConsumerGroupsError
- Detect lack of configuration of Karafka prior to mocking
- Error in v2.3.1: undefined method `ensure_karafka_initialized!' for Karafka::Testing:Module HOT 4
- Incompatibility of Deserializer with Testing
- Multi SG consumer group with high multiplexing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karafka-testing.