freedomofpress / securedrop

GitHub repository for the SecureDrop whistleblower platform. Do not submit tips here!
https://securedrop.org/
Other
3.6k stars 686 forks source link

staging-test-with-rebase flake: test_system_time #6085

Open eloquence opened 3 years ago

eloquence commented 3 years ago

So far only observed once in nightly runs:

assert 'NTPSynchronized=yes' in 'Timezone=Etc/UTC\nLocalRTC=no\nCanNTP=yes\nNTP=yes\nNTPSynchronized=no\nTimeUSec=Sat 2021-08-21 04:58:09 UTC\nRTCTimeUSec=Sat 2021-08-21 04:58:09 UTC\n'
 +  where 'Timezone=Etc/UTC\nLocalRTC=no\nCanNTP=yes\nNTP=yes\nNTPSynchronized=no\nTimeUSec=Sat 2021-08-21 04:58:09 UTC\nRTCTimeUSec=Sat 2021-08-21 04:58:09 UTC\n' = CommandResult(command=b'timedatectl show', exit_status=0, stdout=b'Timezone=Etc/UTC\nLocalRTC=no\nCanNTP=yes\nNTP=yes\...1-08-21 04:58:09 UTC\n', stderr=b"Warning: Permanently added '192.168.121.61' (ECDSA) to the list of known hosts.\r\n").stdout
host = <testinfra.host.Host ansible://app-staging>

    def test_system_time(host: Host) -> None:
        assert not host.package("ntp").is_installed
        assert not host.package("ntpdate").is_installed

        s = host.service("systemd-timesyncd")
        assert s.is_running
        assert s.is_enabled
        assert not s.is_masked

        # File will be touched on every successful synchronization,
        # see 'man systemd-timesyncd'`
        assert host.file("/run/systemd/timesync/synchronized").exists

        c = host.run("timedatectl show")
        assert "NTP=yes" in c.stdout
>       assert "NTPSynchronized=yes" in c.stdout
E       assert 'NTPSynchronized=yes' in 'Timezone=Etc/UTC\nLocalRTC=no\nCanNTP=yes\nNTP=yes\nNTPSynchronized=no\nTimeUSec=Sat 2021-08-21 04:58:09 UTC\nRTCTimeUSec=Sat 2021-08-21 04:58:09 UTC\n'
E        +  where 'Timezone=Etc/UTC\nLocalRTC=no\nCanNTP=yes\nNTP=yes\nNTPSynchronized=no\nTimeUSec=Sat 2021-08-21 04:58:09 UTC\nRTCTimeUSec=Sat 2021-08-21 04:58:09 UTC\n' = CommandResult(command=b'timedatectl show', exit_status=0, stdout=b'Timezone=Etc/UTC\nLocalRTC=no\nCanNTP=yes\nNTP=yes\...1-08-21 04:58:09 UTC\n', stderr=b"Warning: Permanently added '192.168.121.61' (ECDSA) to the list of known hosts.\r\n").stdout

../testinfra/common/test_basic_configuration.py:25: AssertionError
conorsch commented 2 years ago

Saw this again on a feature branch: https://app.circleci.com/pipelines/github/freedomofpress/securedrop/3101/workflows/5a38b8ef-09db-4ea6-b25f-8a60131ece39/jobs/57293

sd-time-failure