Skip to content

Commit

Permalink
tests/log_level_test: test_log_level_persist_a_never_expire_request
Browse files Browse the repository at this point in the history
test that
set log-level admin_api_server trace 10
set log-level admin_api_server error 0

never resets the logger to the info level
  • Loading branch information
andijcr committed May 10, 2024
1 parent d781fb1 commit 84748a8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/rptest/tests/log_level_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,33 @@ def test_log_level_multiple_expiry(self, loggers=tuple[str, str]):
backoff_sec=1,
err_msg=f"Never saw Expiring for {second_logger}")

@cluster(num_nodes=1)
def test_log_level_persist_a_never_expire_request(self):
"""
check that this sequence of actions
set log-level admin_api_server trace 10
set log-level admin_api_server error 0
never resets the logger to the info level
"""
admin = Admin(self.redpanda)
node = self.redpanda.nodes[0]

with self.redpanda.monitor_log(node) as mon:
admin.set_log_level("admin_api_server", "trace", expires=10)
time.sleep(1)
admin.set_log_level("admin_api_server", "error", expires=0)

try:
mon.wait_until("Expiring log level for {admin_api_server}",
timeout_sec=15,
backoff_sec=1)
assert False, "Should not have seen message"
except ducktape.errors.TimeoutError:
pass

level = admin.get_log_level("admin_api_server")[0]["level"]
assert level == "error", f"expected level=error, got {level=}"

@cluster(num_nodes=3)
def test_max_expiry(self):
Expand Down

0 comments on commit 84748a8

Please sign in to comment.