Skip to content

Use gethostname instead of getfqdn to speed-up macOS unit tests in CI#51481

Merged
tgamblin merged 1 commit intospack:developfrom
alalazo:maintainers/speedup-macos-unit-tests
Oct 30, 2025
Merged

Use gethostname instead of getfqdn to speed-up macOS unit tests in CI#51481
tgamblin merged 1 commit intospack:developfrom
alalazo:maintainers/speedup-macos-unit-tests

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Oct 29, 2025

Extracted from #51469

For reference, removing socket.getfqdn improved the unit tests time on macOS:

It's another instance of #46554 that got in through the sbang hook in #47590. Since hooks are run on the child and on macOS the sub-processes are "spawned" (not "forked"), memoization doesn't help.

Signed-off-by: Massimiliano Culpo <[email protected]>
@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Oct 29, 2025

I wonder if we can use NamedTemporaryFile both for the DB and for sbang. That will remove any need to construct a file name to avoid collisions ourselves.

Since we are near to a release, I opted for this minimal change, but if the approach seems good enough we can submit a following PR.

@alalazo alalazo added tests General test capability(ies) maintainers labels Oct 29, 2025
@alalazo alalazo requested a review from tgamblin October 29, 2025 11:22
@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Oct 29, 2025

macos-15-intel is still highly variable, and exceeding 1hr, but this is an improvement nonetheless.

@tgamblin tgamblin merged commit 528a49e into spack:develop Oct 30, 2025
33 of 34 checks passed
@alalazo alalazo deleted the maintainers/speedup-macos-unit-tests branch October 30, 2025 08:20
kshea21 pushed a commit to kshea21/spack that referenced this pull request Nov 4, 2025
`getfqdn` can be extremely slow in CI. Use `gethostname()` instead.

--- 

Signed-off-by: Massimiliano Culpo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainers tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants