Skip to content
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 Flaky Client Certificate Authentication Test #1617

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

MiguelAHM
Copy link
Contributor

@MiguelAHM MiguelAHM commented Dec 31, 2024

This PR attempts to fix the flaky (flapping) integration test:

[ERROR] Failures: 
[ERROR]   ClientCertificateServiceTestIntegration.fail_on_no_client_certificate:38 
Expected: a string containing "javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate"
     but: was "java.io.IOException: Error writing to server"

It seems that the retryFor is not enough. Most of the times it works well after performing an OK request.
There are some time that even performing an OK request is not enough, for those situation I think that we should keep the retryFor. Following this, the test are OK

I think that the root issue is with the setup of the IT for Client Certificate. This requires a deeper look at the integration test set up

@MiguelAHM MiguelAHM marked this pull request as draft December 31, 2024 14:43
assertThat(response, containsString("Found 1 certificate(s)."));
assertThat(response, containsString("-----BEGIN CERTIFICATE-----"));
assertThat(response, containsString("-----END CERTIFICATE-----"));

final ProcessingException processingException = assertThrows(ProcessingException.class,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you expecting a ProcessingException ? The test should succeed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the test retry on ProcessingException ? For example

@RetryFor(value = {IOException.class, ProcessingException.class}, attempts = 10, intervalMs = 10000)

Copy link
Member

@eshryane eshryane Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The successful client_certificate test has been replaced and is now an expected failure? And the failure case fail_on_no_client_certificate has been removed? There should be one success and one failure test.

@@ -223,6 +225,8 @@ public void update_person_missing_private_key_unauthorised() throws Exception {
"mnt-by: OWNER-MNT\n" +
"source: TEST");

sendUpdateRequest(updatedPerson);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was an extra update added to the test?

@eshryane eshryane changed the title Fix Flaky TEST Fix Flaky Client Certificate Authentication Test Jan 8, 2025
@eshryane
Copy link
Member

Alternative : #1625

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants