Skip to content

OF-3119: Relax Happy Eyeballs unit test timing for MacOS#3205

Merged
guusdk merged 2 commits intoigniterealtime:mainfrom
guusdk:OF-3119_CI-macos
Mar 17, 2026
Merged

OF-3119: Relax Happy Eyeballs unit test timing for MacOS#3205
guusdk merged 2 commits intoigniterealtime:mainfrom
guusdk:OF-3119_CI-macos

Conversation

@guusdk
Copy link
Member

@guusdk guusdk commented Mar 17, 2026

Scheduling of Java processes apparently works differently on MacOS, causing tests that depend on sleep-based synchronization to frequently fail. In this PR, modifications have been made to reduce the impact of this (at the expense of granularity).

guusdk added 2 commits March 17, 2026 11:57
…chiverTest

testArchiverInDistinctBatchesWhenOutsideGrace used Thread.sleep() to ensure the archiver had flushed the first item before submitting the second. This relied on the OS thread scheduler waking the archiver thread within the sleep window, which holds on Linux but not on macOS due to differences in thread scheduling behavior between the two platforms.

Replace the sleep with the existing waitUntilArchivingIsDone() helper, which polls until the first item is confirmed stored before archiving the second. This makes the test deterministic regardless of platform or scheduler behavior.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to reduce unit test flakiness on macOS by relaxing/avoiding sleep-based timing assumptions that are sensitive to OS scheduling behavior.

Changes:

  • Adjusts HappyEyeballsResolverTest timing by using a larger resolution delay on macOS.
  • Replaces a Thread.sleep(...) synchronization in ArchiverTest with a helper that waits until archiving has completed.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
xmppserver/src/test/java/org/jivesoftware/openfire/net/HappyEyeballsResolverTest.java Makes the resolution delay OS-dependent to reduce macOS timing flakiness.
xmppserver/src/test/java/org/jivesoftware/openfire/archive/ArchiverTest.java Avoids fixed sleeps by waiting for the archiver to finish storing expected data; updates copyright year.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@guusdk guusdk merged commit 9050981 into igniterealtime:main Mar 17, 2026
51 of 52 checks passed
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