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

rewrite e2e tests #1796

Merged
merged 10 commits into from
Dec 13, 2023
Merged

rewrite e2e tests #1796

merged 10 commits into from
Dec 13, 2023

Conversation

moscicky
Copy link
Collaborator

@moscicky moscicky commented Dec 11, 2023

Rewrite tests which require custom frontend setup:

  • buffer loading test
  • graceful shutdown test
  • https client publishing test
  • publishing on avro topic without schema test
  • attaching keep alive header test

Additionally reuse kafka, zk and schema registry between those tests

@moscicky moscicky marked this pull request as ready for review December 11, 2023 14:42
@moscicky moscicky force-pushed the buffer-loading-test branch 3 times, most recently from 0b91b86 to 934e1e9 Compare December 12, 2023 13:08
private static final String EXISTING_TOPIC_URL = TOPICS_ROOT + EXISTING_TOPIC;
private static final String NOT_EXISTING_TOPIC = "not-existing";
private static final String NOT_EXISTING_TOPIC_URL = TOPICS_ROOT + NOT_EXISTING_TOPIC;
private static final int frontendPort = Ports.nextAvailable();
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't use Ports.nextAvailable(). Take a look at how it is implemented. It opens and closes a socket, potentially leaving it in the TIME_WAIT state. This, in turn, sometimes leads to "Address already in use" errors. Instead, I'd use ephemeral ports - just pass 0 as a port.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch, applied the suggestion in another test

@BeforeEach
public void beforeEach() {
frontend = new HermesFrontendTestApp(infra.hermesZookeeper(), infra.kafka(), infra.schemaRegistry());
frontend.withProperty(FRONTEND_GRACEFUL_SHUTDOWN_ENABLED, false);
Copy link
Member

Choose a reason for hiding this comment

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

If I'm not mistaken, this parameter doesn't affect the tests in this class in any way. Yet it is a bit misleading to set it to true while we are testing that the graceful shutdown is enabled. Perhaps, we can skip setting it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree, I've set it by default as it was in old e2e tests and removed it from this test

import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;

public class AsyncPublisherAutoRetryTest {
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about moving this test to the hermes-client module? Take a look at pl.allegro.tech.hermes.client.ReactiveHermesSenderTest. This one can also be considered an integration test but is placed in the hermes-client module.

The other way around approach is also possible, of course, but I lean towards having only tests in the integration-tests module that span multiple hermes modules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looking more into this I wonder if this test is needed at all. In hermes-client module we already have tests covering cases tested here. I'd vote for removing this test class completely

@moscicky moscicky merged commit 555c564 into integration_tests_framework Dec 13, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants