Skip to content

ZTS: snapshot_018_pos.ksh add extra margin#18450

Open
behlendorf wants to merge 1 commit intoopenzfs:masterfrom
behlendorf:zts-snapshot_018_pos
Open

ZTS: snapshot_018_pos.ksh add extra margin#18450
behlendorf wants to merge 1 commit intoopenzfs:masterfrom
behlendorf:zts-snapshot_018_pos

Conversation

@behlendorf
Copy link
Copy Markdown
Contributor

@behlendorf behlendorf commented Apr 22, 2026

Motivation and Context

https://github.com/openzfs/zfs/actions/runs/24764467025/job/72455377060?pr=18445

...
  08:26:05.98 SUCCESS: zfs mount testpool/testfs
  08:26:05.99 SUCCESS: eval [[ 1776846365 == 1776846365 ]]
  08:26:05.99 SUCCESS: eval [[ 1776846365889999399 == 1776846365889999399 ]]
  08:26:06.00 SUCCESS: eval [[ 1776846365 ==  1776846365 ]]
  08:26:06.02 SUCCESS: zfs destroy testpool/testfs@v1
  08:26:06.03 ERROR: eval [[ 1776846365 -ge 1776846366 ]] exited 1

Description

The date(1) command and snapshot timestamps use different clock sources which can result in a small discrepancy. This can cause the test the incorrectly fail. To avoid this, add a brief delay to the test case to allow for minor skew.

How Has This Been Tested?

Will be tested by the CI.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • [q] Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

The date(1) command and snapshot timestamps use different clock
sources which can result in a small discrepency.  This can cause
the test the incorrectly fail.  To avoid this, add a brief delay
to the test case to allow for minor skew.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Copilot AI review requested due to automatic review settings April 22, 2026 16:48
@behlendorf behlendorf added Component: Test Suite Indicates an issue with the test framework or a test case Status: Code Review Needed Ready for review and testing labels Apr 22, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a ZTS flake in snapshot_018_pos.ksh where snapshot timestamps can be slightly behind date(1) due to differing clock sources, causing occasional failures in snapshots_changed time comparisons.

Changes:

  • Insert a 1-second delay after capturing curr_time and before snapshot/destroy operations to tolerate minor timestamp skew.
  • Apply the delay consistently across all the test’s curr_time-based timestamp assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Test Suite Indicates an issue with the test framework or a test case Status: Code Review Needed Ready for review and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants