Skip to content

Fix flaky test_008_restart - #737

Closed
notroj wants to merge 1 commit into
apache:trunkfrom
notroj:flaky-restart-tests
Closed

Fix flaky test_008_restart#737
notroj wants to merge 1 commit into
apache:trunkfrom
notroj:flaky-restart-tests

Conversation

@notroj

@notroj notroj commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

see also #733

…tests.

* test/pyhttpd/log.py (HttpdErrorLog.current_pos, .wait_for): New
  methods, to wait for a line logged after a noted position.

* test/pyhttpd/env.py (HttpdTestEnv._apache_signal_restart): New method:
  run "httpd -k restart" or "-k graceful", which only signal the parent,
  then wait for the MPM to log "resuming normal operations" before
  checking is_live().  Until then the answer may come from the old
  generation, with the old config and about to be killed, which showed
  up as an empty reply in test_core_008_03_repeated under ASan.
  (apache_reload, apache_hard_restart): Use it.

Fixes: 7172909 ("test/modules/core/test_008_restart.py: New test suite for server restart handling.")
Fixes: 31d91bb ("test/pyhttpd/env.py (HttpdTestEnv.apache_hard_restart, read_pid_file): Moved here from the mod_systemd tests")
Fixes: 4abdd20 ("test/modules/arch/linux/: New test suite.")
GitHub: see also apache#733

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@notroj

notroj commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Cause - from Claude

HttpdTestEnv.apache_hard_restart() ran httpd -k restart, which only
sends SIGHUP to the parent and returns, and then is_live(), which is
satisfied by the first answered request. The parent restarts
asynchronously (event.c event_run: reap the old children with SIGTERM,
startup_children, then log AH00489 "resuming normal operations"), so the
answer is_live() accepts can come from an old child which is about to be
killed. The test's own request then lands on an old child, which dies
mid-request: empty reply.

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.

1 participant