Skip to content

Wait longer in tests for macOS file watchers and the live cloud service - #217

Merged
jwrosewell merged 6 commits into
rcfrom
fix/macos-watcher-wait
Nov 21, 2026
Merged

jwrosewell merged 6 commits into
rcfrom
fix/macos-watcher-wait

Conversation

@51DTechResponse

@51DTechResponse 51DTechResponse commented Nov 20, 2026 •

Copy link
Copy Markdown

Why

The release build of #190 (run 44702767584) failed on two of its six macOS jobs. The test was RelativePathTests.dataFile_Relative_WatcherLoadsANewFile. It gave up after 10.21 s on MacOS_Java_11 and 10.13 s on MacOS_X64_Java_11.

Java's WatchService has no native file events on macOS. It polls instead, every 10 seconds by default. So a new file can take 10 seconds or more to show up, and the test allowed exactly 10.

DataUpdateServiceWatchedFileTests and DataUpdateServiceCheckFailureTests used the same 10 second wait. They passed in that build, but they're just as exposed.

The same build had a second, separate failure. ValueCloudTests errored on Ubuntu_Java_8 and Windows_Java_21 with "Read timed out" at about 08:38 UTC. The live cloud service took longer than the cloud request engine's 2 second default to answer.

What changed

  • WAIT_FOR_EVENT_MILLIS goes from 10000 to 30000 in the three watcher test classes. That's three macOS polls.
  • Every wait that uses it is a loop, an await, or a join on a thread, and each one returns early, as soon as the change arrives or the thread ends. A fast machine finishes just as quickly as before. The 30 seconds only counts when an event is late.
  • A comment on each constant says why, with the run id and both failing times.
  • The test wrappers for the device detection, IP intelligence, and geolocation cloud tests now build their cloud request engine with setTimeOutSeconds(15). Each has a comment naming the run that timed out.

Only test code changes. No library code or default moves.

Run

Run 44775849116 built this head with one temporary workflow file added. It covers every Build and Test job, macOS included, and all 15 of those jobs passed.

No red

There's no failing-test-first run. These commits widen limits in tests that already exist, so there's no new test that could go red ahead of the fix. Run 44702767584 is the record of the failure.

Before you upgrade

Nothing. Only tests change.

Merging

Subject: Wait longer in tests for macOS file watchers and the live cloud service
Body: The watcher tests wait up to 30 seconds, three of macOS's 10 second polls, and stop as soon as the change arrives. The live cloud tests' engines get a 15 second timeout. Tests only.

Head c35cc6e.

Tracy51D and others added 6 commits November 20, 2026 16:38
… watch service polls every 10 seconds on macOS
… cloud service can take longer than the 2 second default
… tests are skipped on macOS

Every wait on WAIT_FOR_EVENT_MILLIS in DataUpdateServiceWatchedFileTests and DataUpdateServiceCheckFailureTests is in a test skipped on macOS, so the macOS polling reason does not apply to them. Off macOS, run 44775849116 finished each class in 2.2 s or less.
The device detection, IP intelligence and geolocation cloud test wrappers send their requests through a client that prints each request's path and time, so every run records what the tests' cloud timeout is sized from. Only the path is printed, never the query.
…cond timeout

Run 44881631156 printed 540 live cloud requests across all 15 Build and Test jobs, the slowest at 0.77 s. The timeout comments now give those times and name device detection's ValueCloudTests as the class that timed out in run 44702767584. The printed path no longer shows the Resource Key segment.
rc now reads the test resource key only under its _51DEGREES_ name in
the Device Detection and IP Intelligence cloud test wrappers. This
change gives the same lines a timed HTTP client and a 15 second
timeout. The merge keeps the timed client and the timeout, with the key
read as rc reads it.
@jwrosewell
jwrosewell marked this pull request as ready for review November 21, 2026 21:11
@jwrosewell
jwrosewell merged commit eee3c93 into rc Nov 21, 2026
4 checks passed
@jwrosewell
jwrosewell deleted the fix/macos-watcher-wait branch November 21, 2026 21:11
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.

4 participants