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

Flaky distribution tests in jetty-12 #11690

Open
gregw opened this issue Apr 24, 2024 · 0 comments
Open

Flaky distribution tests in jetty-12 #11690

gregw opened this issue Apr 24, 2024 · 0 comments
Labels
Bug For general bugs on Jetty side flaky-test

Comments

@gregw
Copy link
Contributor

gregw commented Apr 24, 2024

Jetty version(s)
12
Jetty Environment
all

Description

We have many distribution tests that do something like:

                    assertTrue(run3.awaitConsoleLogsFor("Started oejs.Server@", START_TIMEOUT, TimeUnit.SECONDS));
                    ContentResponse response = client.GET("http://localhost:" + port + "/test/sometest.txt");

However, the "Started" log is emitted whilst the context is still Starting, so if the client response is quick it will arrive at the context and be handled by:

        if (handler == null || !isStarted())
            return false;

So the client loses the race and the request is 404'd

A fix for this is to turn on debug for the deployer and wait like:

                // Wait for start context
                assertTrue(run2.awaitConsoleLogsFor("Started oeje10w.WebAppContext@", START_TIMEOUT, TimeUnit.SECONDS));
                // wait for deployer node to complete so context is Started not Starting
                assertTrue(run2.awaitConsoleLogsFor("Executing Node Node[started]", START_TIMEOUT, TimeUnit.SECONDS));
                ContentResponse response = client.GET("http://localhost:" + port + "/test/sometest.txt");
@gregw gregw added the Bug For general bugs on Jetty side label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side flaky-test
Projects
None yet
Development

No branches or pull requests

2 participants