-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix github actions build failure #1054
Conversation
Thanks! |
note for myself, things to do here:
|
.github/workflows/maven.yaml
Outdated
@@ -188,11 +184,17 @@ jobs: | |||
|
|||
diff=$((right_bound - left_bound)) | |||
sliced_array=("${CLASSNAMES[@]:$left_bound:$diff}") | |||
TEST_ARG=$(echo $sliced_array | sed 's/ /,/g') | |||
TEST_ARG=$(echo ${sliced_array[@]} | sed 's/ /,/g') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a bug here, I was only running the first test from a sliced_array
, fixed.
just found one more problem here with |
@@ -1,107 +0,0 @@ | |||
/* | |||
* Copyright 2013-2020 the original author or authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two files were not used, I noticed this by accident
.github/workflows/maven.yaml
Outdated
# - find all tests | ||
# - exclude Fabric8IstionIT | ||
# - only take classes that have @Test inside them | ||
# - ignore the ones that have 'abstract class'. we do this because otherwise we would pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this small comment explains the problem, I noticed this by accident and could reproduce locally too... fixed via this logic.
@@ -43,6 +43,11 @@ jobs: | |||
# needed for .withReuse(true) to work | |||
echo "testcontainers.reuse.enable=true" > ~/.testcontainers.properties | |||
- checkout | |||
- restore_cache: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore cache for tests
this gets funner and funner, it seems with 653 tests we are hitting this issue |
I am still in the blur what is going on here. The test indeed fails (
So we start the application, then create a configmap with the same name and a proper label, this should trigger the informer (it does), in turn this will call
I don't see anything there. Weird. Still trying to figure out what is going on |
@@ -140,6 +141,8 @@ void after() throws Exception { | |||
k8SUtils.waitForDeploymentToBeDeleted(SPRING_CLOUD_K8S_CONFIG_WATCHER_IT_DEPLOYMENT_NAME, NAMESPACE); | |||
} | |||
|
|||
// TODO figure out why this one fails on bus-starter-4.0.0-SNAPSHOT | |||
@Disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am disabling it for now. I've spent a few good days trying to figure out what is going on here, but my limited understanding of bus/binders/functions/kafka/etc did not help. I'll try to spent some more time in the future, as I don't like disabling this at all :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done the same test in 2.1.x
branch and when I do bin/kafka-console-consumer.sh --topic springCloudBus --from-beginning --bootstrap-server localhost:9092
, I do get a message in the kafka topic. interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you can reproduce this locally? What do I need to do to reproduce it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's going to be a bit of mouthful to explain how to reproduce this locally, but in the meanwhile I am on to something (I think). May be you know this off the top of your head.
So in 2.1.x
we get a Bean from BusRefreshAutoConfiguration
called : RefreshListener
:
@Bean
@ConditionalOnProperty(
value = {"spring.cloud.bus.refresh.enabled"},
matchIfMissing = true
)
@ConditionalOnBean({ContextRefresher.class})
public RefreshListener refreshListener(ContextRefresher contextRefresher, ServiceMatcher serviceMatcher) {
return new RefreshListener(contextRefresher, serviceMatcher);
}
After this one is invoked, the message ends up in the kafka queue.
What is interested is that this Bean is present in main
- I can get it from the context, but it's not present in the "applicationListeners" of the app. It's almost like there should be some code that registers it, but it's not. I'm sorry if this is obscure explanation, but I am still trying to figure out...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, the autoconfiguration runs in main though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, it does not even matter if that name is wrong. You would still not see a message in the kafka queue, and that is the main problem. If you look at my example, I do not even have a consumer ( there is no spring-cloud-kubernetes-configuration-watcher-it
deployed ).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also do not know if you noticed, but the problem is for sure in a SNAPSHOT version. While this test was failing, the circleci one was passing - and we had a bug there where the cache was not updating with the latest snapshots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was talking to some people yesterday and there were some changes in Kafka recently that seems to correlate with the timeframe in which we saw these failures. I am looking into it some more. Hopefully will have an update next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK so I finally nailed down that was happening after I was able to reproduce the problem using a simple Spring Cloud Bus + Kafka app. This exception was being thrown when we called triggerRefresh
java.lang.NoSuchMethodError: 'org.springframework.util.concurrent.ListenableFuture org.springframework.kafka.core.KafkaTemplate.send(org.apache.kafka.clients.producer.ProducerRecord)'
at org.springframework.integration.kafka.outbound.KafkaProducerMessageHandler.handleRequestMessage(KafkaProducerMessageHandler.java:513) ~[spring-integration-kafka-6.0.0-M4.jar:6.0.0-M4]
The reason why we didn't see it is because the ExecutorService was swallowing it 🤦♂️.
I added a try/catch with a log statement around that call so we can catch anything like this in the future.
Line 69 in 17b61c2
triggerRefresh(configMap).subscribe(); |
The reason for the NoSuchMethodError was because there was a chance in Spring Core to ListenableFuture
but the Spring Boot snapshots were using Spring Integration Milestone 4 which didn't have the corresponding change to support the change to ListenableFuture
. I got the Boot team to move Spring Integration to snapshots and that fixed the underlying problem.
So we should be able to remove the @Ignore
from the test now and that build should pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE!! Indeed it builds just fine now :) take a look when you have time
No description provided.