-
Notifications
You must be signed in to change notification settings - Fork 572
ci: tav tests failing for kafkajs v1.7.0 #2784
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
Comments
I guess the options are
|
Interesting. I think we inadvertently skipped testing below 1.x with #2758 with the |
@JamieDanielson |
Possibly because TAV will abort on the first failure. So because it is failing on 1.7.0, it doesn't get down to 0.x versions. |
Yah, you can see that by running tav with the
|
Oops sorry about that! Basically I clicked on a workflow run in a previous PR, clicked Raw Logs, and searched through there. |
Ah good to know, thank you! |
first issue: failing with [email protected] and lowerI am guessing that part of the #2752 change used this to attempt to not change the Partitioner that was being used for tests: producer = kafka.producer({
createPartitioner: kafkajs.Partitioners.LegacyPartitioner,
}); https://github.com/tulios/kafkajs/blob/master/docs/Producing.md#default-partitioners talks about producer = kafka.producer(
kafkajs.Partitioners?.LegacyPartitioner && {
createPartitioner: kafkajs.Partitioners.LegacyPartitioner,
}
); which works. But this also works: producer = kafka.producer(); I prefer the latter, because we are then testing with the kafka Producer defaults instead of tying to a legacy client thing for no particular reason. Making this change gets more versions passing, but we start failing on v1.4.8:
second issue: failing with [email protected] and lowerThe test failure is this:
#2752 added support for the commit b9581cb96f077240e848094d79778bb8a3ac2c2e
Date: 2018-12-07T17:06:38+01:00 (6 years ago)
Accept network instrumentation events on the producer
diff --git a/src/producer/instrumentationEvents.js b/src/producer/instrumentationEvents.js
index c5eb56c4..95fb68a2 100644
--- a/src/producer/instrumentationEvents.js
+++ b/src/producer/instrumentationEvents.js
@@ -1,7 +1,26 @@
+const swapObject = require('../utils/swapObject')
+const networkEvents = require('../network/InstrumentationEvents')
const InstrumentationEventType = require('../instrumentation/eventType')
const producerType = InstrumentationEventType('producer')
-module.exports = {
+const events = {
CONNECT: producerType('connect'),
DISCONNECT: producerType('disconnect'),
+ REQUEST: producerType(networkEvents.NETWORK_REQUEST),
+ REQUEST_TIMEOUT: producerType(networkEvents.NETWORK_REQUEST_TIMEOUT),
+} We can fix this by not supporting the metric in older kafkajs versions: --- a/plugins/node/instrumentation-kafkajs/src/instrumentation.ts
+++ b/plugins/node/instrumentation-kafkajs/src/instrumentation.ts
@@ -251,10 +251,13 @@ export class KafkaJsInstrumentation extends InstrumentationBase<KafkaJsInstrumen
private _setKafkaEventListeners(kafkaObj: KafkaEventEmitter) {
if (kafkaObj[EVENT_LISTENERS_SET]) return;
- kafkaObj.on(
- kafkaObj.events.REQUEST,
- this._recordClientDurationMetric.bind(this)
- );
+ // The REQUEST Consumer event was added in [email protected].
+ if (kafkaObj.events?.REQUEST) {
+ kafkaObj.on(
+ kafkaObj.on(
+ kafkaObj.events.REQUEST,
+ this._recordClientDurationMetric.bind(this)
+ );
+ } After this tests pass. (I guess there isn't a test for that particular metric being emitted.) |
…d earlier The tests broke on [email protected] and earlier. The instrumentation crashed on [email protected] and earlier. Refs: open-telemetry#2784 (comment) Fixes: open-telemetry#2784
…d earlier (#2787) The tests broke on [email protected] and earlier. The instrumentation crashed on [email protected] and earlier. Refs: #2784 (comment) Fixes: #2784
TAV tests are failing for kafka instrumentation on an older version of kafkajs.
In older tests, there were warnings about a change in KafkaJS v2.0.0 for default partitioners. To see this, search the raw log for
required packages ["kafkajs@2.
.In #2752 we updated the test to remove the warning, with
createPartitioner: kafkajs.Partitioners.LegacyPartitioner
. It seems that PR didn't run TAV tests so we didn't see the failing test.Now we have a failing test with "[email protected]":
TypeError: Cannot read properties of undefined (reading 'LegacyPartitioner')
The text was updated successfully, but these errors were encountered: