Skip to content

Commit

Permalink
Work around long update check interval in controller with a restart
Browse files Browse the repository at this point in the history
Previously, the base/proxy-and-update e2e test passed, because
the controller considered `latest < {booted,inactive}` an error state
and triggered an update check "quickly" (in 30 seconds).

This was changed with commit d8053bd
which changed the interpration of this state to `UpToDate` i.e. a
non-error state, therefore entering a long sleep of 1 hour.

As a work-around, we restart the controller to trigger an update check.
This is ugly and potentially hides bugs, should be eliminated once
the runtime configuration option is added.
  • Loading branch information
yfyf committed Oct 24, 2024
1 parent 53d04e6 commit 1831876
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions testing/end-to-end/tests/base/proxy-and-update.nix
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,17 @@ pkgs.testers.runNixOSTest {
wait_for_logs(playos, expected_kiosk_logs)
with TestCase("Controller is able to query the version"):
expected_controller_log = f"latest.*{current_version}"
wait_for_logs(playos,
expected_controller_log,
unit="playos-controller.service",
# this should not be longer than 30, could there be some
# DNS cache somehwere?
timeout=61)
expected_states = [
"GettingVersionInfo",
"UpToDate",
f"latest.*{current_version}"
]
for state in expected_states:
wait_for_logs(playos,
state,
unit="playos-controller.service",
timeout=61)
with TestCase("Controller installs the new upstream version") as t:
next_version = "${nextVersion}"
Expand All @@ -191,6 +195,10 @@ pkgs.testers.runNixOSTest {
update_server.add_bundle(next_version, filepath="/tmp/next-bundle.raucb")
update_server.set_latest_version(next_version)
# reboot controller to trigger version check
# TODO: override config to reduce check interval instead
playos.systemctl("restart playos-controller.service")
expected_states = [
"Downloading",
f"Installing.*{update_server.bundle_filename(next_version)}",
Expand Down

0 comments on commit 1831876

Please sign in to comment.