Skip to content

Commit

Permalink
WIP1
Browse files Browse the repository at this point in the history
  • Loading branch information
MoessnerFabian(Group) committed Jan 30, 2025
1 parent 9e74650 commit 0068804
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/acceptance/test_config_refresh.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable=missing-docstring
import tempfile
from pathlib import Path
import time

import pytest
from ruamel.yaml import YAML
Expand Down Expand Up @@ -73,3 +74,21 @@ def test_no_config_refresh_after_5_seconds(tmp_path, config):
"Configuration version didn't change. Continue running with current version.",
test_timeout=7,
)


def test_recover_after_invalid_then_valid_config(tmp_path, config):
config_path = tmp_path / "generated_config.yml"
config_path.write_text(config.as_json())
proc = start_logprep(config_path)
wait_for_output(proc, "Config refresh interval is set to: 5 seconds", test_timeout=5)

config.config_refresh_interval = None
config.version = "invalid"
config_path.write_text(config.as_json())
time.sleep(3)

config.config_refresh_interval = 4
config.version = "valid_again"
config_path.write_text(config.as_json())
wait_for_output(proc, "Successfully reloaded configuration", test_timeout=10)
wait_for_output(proc, "Config refresh interval is set to: 4 seconds", test_timeout=5)

0 comments on commit 0068804

Please sign in to comment.