-
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
Refactor some integration tests #1359
Refactor some integration tests #1359
Conversation
Configure Renovate
/** | ||
* equivalent of 'docker system prune', but for crictl. | ||
*/ | ||
public static void systemPrune() { |
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 think there has to be an honest opinion about this: I was an idiot, this should have never existed. The logs were miss-leading and I got trapped into thinking that this solved our problem. It did not.
Our fix with "system prune", while it does not hurt anything, it is not solving much either. I started digging and found this one: k3s-io/k3s#1857 The problem we are seeing with those logs are related to k3s itself, and they have no impact on the cluster.
I'm dropping it.
@@ -612,38 +649,6 @@ private static String labelSelector(Map<String, String> labels) { | |||
return labels.entrySet().stream().map(en -> en.getKey() + "=" + en.getValue()).collect(Collectors.joining(",")); | |||
} | |||
|
|||
private String events() { |
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 were added as part of me trying to understand what is wrong with the cluster when integration tests are failing, now that I know : we do not need them. In its fairness, they never helped, they were useless. Worse, I started looking into these logs, saw "a problem" (that's why systemPrune
was introduced). That was never the real cause of the tests failing.
This PR has two purposes:
It changes the way we do integration tests, partially, for at least one package. The easiest way to explain is via an example. Consider two tests In
In
The only difference between these two tests is what selective namespaces we use for assertions. If that is the case, then why deploy and redeploy everything again and again when the only thing that needs to change is ONE single environment variable (the selective namespace one). So why not patch the existing deployment (it will trigger a restart of pods), then make our assertions. This cuts the run of the tests by tens of minutes. The downside is that the code is slightly more involved to follow and may be a bit more cumbersome to debug, but considering the massive gains we get on the pipeline, this is nothing, imo. Tests have not changed logically one bit, all that was changed is that now I make a few in order and issue This is the reason our pipeline build fails at times. It takes a lot of time to schedule this deployment and give it enough resources on the cluster that we get on github actions. The issue is the CPU - we only get 2 cores there. |
@@ -51,7 +54,8 @@ | |||
/** | |||
* @author wind57 | |||
*/ | |||
class KubernetesClientDiscoveryClientIT { | |||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) |
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.
tests now need to run in a certain order, because we patch the deployment with new env variables, so we need to preserver order for correctness.
@ryanjbaxter ready to be looked at, thank you |
No description provided.