Skip to content

Build the relup before connecting in upgrade_SUITE - #360

Closed
grok-99s wants to merge 1 commit into
ninenines:masterfrom
grok-99s:fix-upgrade-idle-timeout
Closed

grok-99s wants to merge 1 commit into
ninenines:masterfrom
grok-99s:fix-upgrade-idle-timeout

Conversation

@grok-99s

@grok-99s grok-99s commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

upgrade_SUITE:do_upgrade_ranch_one_conn fails intermittently on macOS with {badmatch,{error,closed}} at line 215, the first recv after the upgrade. Seen in scheduled runs on 2026-09-07, 09-14, 09-21 and 10-05 (OTP 27, 28, 29 and master on macos-14), for example the OTP-29.1.1 macOS job of run 37262937056.

The cause is the example's echo_protocol: it calls recv with a 60s timeout and closes the connection when that expires. The test opened S1 and then built the relup while S1 sat idle. In the failing job, S1 was used at 04:22:38 and next used at 04:23:49, which is 71s later, so the server had already closed it. The passing OTP-28.5.0.7 macOS job in the same run had a 59.5s gap.

This change builds the relup before S1 is opened. The release that is running still uses the previous Ranch version, so S1 is still opened before the upgrade, and the test still checks that it survives the upgrade and the downgrade. Now only the upgrade itself runs between S1's checks, which takes about 2s.

The master OTP failures at line 207 (econnrefused) are not addressed here. In those jobs the rebar3 bootstrap fails to compile on OTP master because erlang:exit/2 is deprecated, so the release never starts.

Verified locally: make ct-upgrade passes (OTP 27.3.4.1).

The echo protocol closes connections after 60s without data.
Building the relup can take longer than that on slower
runners, which made the test fail with {error,closed}.
@essen

essen commented Oct 9, 2026

Copy link
Copy Markdown
Member

Merged, thanks!

@essen essen closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants