Skip to content

Add foreman.target lifecycle tests (stop/start and restart)#409

Merged
evgeni merged 2 commits intotheforeman:masterfrom
pablomh:target_tests
Mar 20, 2026
Merged

Add foreman.target lifecycle tests (stop/start and restart)#409
evgeni merged 2 commits intotheforeman:masterfrom
pablomh:target_tests

Conversation

@pablomh
Copy link
Copy Markdown
Contributor

@pablomh pablomh commented Mar 15, 2026

Extends foreman_target_test.py with lifecycle tests intended to run at the end of the test suite. Tests that foreman.target can be cleanly stopped and restarted, and that Foreman becomes available again afterwards via the HTTPS endpoint (same curl pattern as test_https_foreman_ping in httpd_test.py).

@pablomh pablomh closed this Mar 17, 2026
@pablomh pablomh reopened this Mar 17, 2026
@pablomh pablomh marked this pull request as draft March 17, 2026 10:54
@pablomh pablomh marked this pull request as ready for review March 17, 2026 14:54
@pablomh
Copy link
Copy Markdown
Contributor Author

pablomh commented Mar 17, 2026

This one requires #412 to run reliably.

@evgeni
Copy link
Copy Markdown
Member

evgeni commented Mar 18, 2026

@pablomh mind rebasing this one?

Extends foreman_target_test.py with lifecycle tests intended to run
at the end of the test suite. Tests that foreman.target can be cleanly
stopped and restarted, and that Foreman becomes available again
afterwards via the HTTPS endpoint (same curl pattern as
test_https_foreman_ping in httpd_test.py).
@evgeni
Copy link
Copy Markdown
Member

evgeni commented Mar 18, 2026

Mhh, still failing

@pablomh
Copy link
Copy Markdown
Contributor Author

pablomh commented Mar 19, 2026

I'm confident that the final fix is #413.

I thought that it was the "logical" dependency, but didn't find the issue it in my testing because of timing.

@pablomh pablomh marked this pull request as draft March 19, 2026 15:10
Foreman depends on Candlepin being fully initialised before it can
serve requests reliably. Without this ordering, foreman.service starts
simultaneously with candlepin.service, competing for CPU and disk I/O
during the JVM startup. This pushes Rails loading time close to the
default TimeoutStartSec (90s) and causes intermittent failures on
restart, particularly when the system is under load.

Because candlepin.service already declares:
  After=redis.service postgresql.service

the transitive ordering becomes:

  postgresql --+
               +--> candlepin --> foreman
  redis -------+

so explicit redis.service and postgresql.service dependencies on
foreman.service are not needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pablomh pablomh marked this pull request as ready for review March 19, 2026 16:09
@evgeni evgeni merged commit 5a2eb8b into theforeman:master Mar 20, 2026
11 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