Skip to content

Speed up test runs to ~30s (from 150s+)#390

Open
mgaffigan wants to merge 4 commits into
OpenIntegrationEngine:mainfrom
mgaffigan:fix/slow-tests
Open

Speed up test runs to ~30s (from 150s+)#390
mgaffigan wants to merge 4 commits into
OpenIntegrationEngine:mainfrom
mgaffigan:fix/slow-tests

Conversation

@mgaffigan

@mgaffigan mgaffigan commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

TcpDispatcherTest was doing lots of sleeping to for synchronization. Avoid that by using latches and other synchronization. Also: avoid 9s of waiting for the 111.1.1.1 IP to be bindable. Saves 90s or so.

TcpRecieverTest had another 10s of sleeps.

PropertiesConfig had another 7s.

Enabling parallel execution gave additional 20s+ back.

No expected behavior changes nor gaps in coverage. Tested in a loop for stability:

while JAVA_HOME="/Users/mgaffigan/dev/zulu17.60.17-ca-fx-jdk17.0.16-macosx_aarch64" ./gradlew build -PdisableSigning=true && git clean -fdx; do :; done

Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown

Test Results

654 tests  ±0   654 ✅ ±0   2m 16s ⏱️ -26s
108 suites ±0     0 💤 ±0 
108 files   ±0     0 ❌ ±0 

Results for commit a1a5849. ± Comparison against base commit ac47cc8.

♻️ This comment has been updated with latest results.

Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
@mgaffigan mgaffigan changed the title Speed up TcpDispatcherTest to cut 90 seconds out of test runs Speed up test runs to ~30s (from 150s+) Jul 26, 2026
NicoPiel
NicoPiel previously approved these changes Jul 26, 2026
@mgaffigan
mgaffigan marked this pull request as draft July 26, 2026 00:33
@mgaffigan
mgaffigan marked this pull request as ready for review July 26, 2026 16:03
@mgaffigan

Copy link
Copy Markdown
Contributor Author

Sorry @NicoPiel, I had missed a push. Thanks for the review :)

@NicoPiel NicoPiel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No worries. I love these kinds of speed-ups.

@pacmano1 pacmano1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving.

I'd probably comment on the changed address you used, so nobody "helpfully" fixes it later. The old 9s wasn't DNS. 111.1.1.1 is a valid literal, no lookup. It fails at bind() and hits the retry loop in TcpDispatcher.createServerSocket(): 10 tries, hardcoded sleep(1000) each.

256.256.256.256 isn't a valid literal, so getByName does a DNS lookup instead. Normally a fast NXDOMAIN, so it throws UnknownHostException and skips the loop. That's the speedup.

Fine for a test that just checks startup fails with ConnectorTaskException. Two things worth capturing: it's invalid on purpose (make it routable and the 9s loop is back), and it leans on the resolver returning NXDOMAIN fast. A slow or hijacking resolver brings the wait back the other way.

@mgaffigan

Copy link
Copy Markdown
Contributor Author

@pacmano1, agreed on all points.

I was able to change the timeout on the receiver test (so that one could remain the valid 111.1.1.1), but did not see a clean way to do the same on the dispatcher test.

Since the test is basically a duplicate of the receiver test, I left it with the DNS error.

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.

3 participants