Details
Description
Given the number of tickets filed, the Beaker timesync method has a bad reliability track record.
For instance, when called against a Windows vmpooler host that is already properly configured to synchronize time, calling timesync will actually incorrectly set the time, output the message The computer did not resync because the required time change was too big, and it may take several minutes for the time to properly set. This could lead to cert requests being generated with the wrong timestamps or other non-deterministic time-related behavior that could be difficult / confusing to debug. Windows packer template changes are responsible for setting relevant GP settings in the registry up-front.
I spent a bit of time trying to find a sequence of steps that could be reliably called against a Windows vmpooler machine, that would not generate error messages, and I was not successful. More detailed notes are available in PCP-625 comments - the code currently in Beaker is https://github.com/puppetlabs/beaker/blame/355c946185bdda0a67643718b556ccc42a069f24/lib/beaker/host_prebuilt_steps.rb#L43-L51
That said, I recognize the importance of having a deterministic timesync helper for 3rd parties using Beaker, where nodes under test may not have a time synchronization mechanism rigged up - even if it's proving fragile / unnecessary for internal infrastructure in vmpooler.
Some ideas:
- Deprecate the helper and remove it in a later version (or potentially make it no-op)
- Add documentation to Beaker noting the pitfalls of calling timesync under certain circumstances - it's particularly tricky for internal Puppet testing now as some templates have time synchronization baked in, while others do not (yet)
- Spend more time on a more robust Windows solution - while I did attempt to avoid failures when enabling the w32time service and calling w32tm /resync, I did not perform any tests to see if the node was already configured. Perhaps there is a way to avoid running sync commands when a node is already synced. (There are some notes about Windows time sync commands, and using wmic to set dates that might prove useful)
Attachments
Issue Links
- relates to
-
IMAGES-715 Investigate TimeSync Behaviour on Windows vmpooler images
-
- Closed
-
-
BKR-773 beaker timesync method fails on OSX 10.11 due to ntpd service running
-
- Resolved
-
-
BKR-797 timesync method fails when ntp service running
-
- Resolved
-
-
BKR-960 timesync does not work on ciscoxr-64a
-
- Resolved
-
-
IMAGES-111 Configure Time Sync and Time Zone (W2012R2/2016)
-
- Closed
-
-
PCP-625 pxp-agent - Tests fail timesync on windows2016-6432a and windows10ent
-
- Closed
-