Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZTS: Fix non-portable date format #10170

Merged
merged 1 commit into from
Apr 6, 2020

Conversation

ghost
Copy link

@ghost ghost commented Apr 1, 2020

Motivation and Context

The delegate tests use date(1) to generate snapshot names, using
the format '%F-%T-%N' to get nanosecond resolution (since multiple
snapshots may be taken in the same second). '%N' is not portable, and
causes tests to fail on FreeBSD.

Description

Since the only purpose these timestamps serve is to create a unique
name, simply use $RANDOM instead.

How Has This Been Tested?

ZTS on FreeBSD

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)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the ZFS on Linux code style requirements.
  • I have updated the documentation accordingly.
  • I have read the contributing document.
  • I have added tests to cover my changes.
  • I have run the ZFS Test Suite with this change applied.
  • All commit messages are properly formatted and contain Signed-off-by.

@ghost ghost 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 1, 2020
@ghost ghost requested a review from jwk404 April 1, 2020 17:30
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 1, 2020
The delegate tests use `date(1)` to generate snapshot names, using
the format '%F-%T-%N' to get nanosecond resolution (since multiple
snapshots may be taken in the same second).  '%N' is not portable, and
causes tests to fail on FreeBSD.

Since the only purpose these timestamps serve is to create a unique
name, simply use $RANDOM instead.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
@ghost
Copy link
Author

ghost commented Apr 2, 2020

  • Replaced timestamp with $RANDOM

@ghost
Copy link
Author

ghost commented Apr 2, 2020

LOL all the test bots failed by coincidence, but the tests did pass :P

@codecov-io
Copy link

codecov-io commented Apr 2, 2020

Codecov Report

Merging #10170 into master will increase coverage by 0.41%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10170      +/-   ##
==========================================
+ Coverage   78.98%   79.39%   +0.41%     
==========================================
  Files         385      385              
  Lines      122594   122594              
==========================================
+ Hits        96831    97339     +508     
+ Misses      25763    25255     -508     
Flag Coverage Δ
#kernel 79.76% <ø> (+0.14%) ⬆️
#user 66.26% <ø> (+1.32%) ⬆️
Impacted Files Coverage Δ
cmd/zdb/zdb_il.c 30.86% <0.00%> (-24.08%) ⬇️
lib/libzutil/os/linux/zutil_import_os.c 77.74% <0.00%> (-0.67%) ⬇️
module/zfs/zio_checksum.c 97.75% <0.00%> (-0.57%) ⬇️
module/zfs/vdev_indirect_mapping.c 98.55% <0.00%> (-0.49%) ⬇️
module/zfs/zfs_quota.c 86.57% <0.00%> (-0.47%) ⬇️
module/zfs/dmu_objset.c 91.62% <0.00%> (-0.24%) ⬇️
module/os/linux/zfs/zfs_dir.c 82.91% <0.00%> (-0.23%) ⬇️
module/zfs/dmu_redact.c 82.15% <0.00%> (-0.23%) ⬇️
module/zfs/sa.c 84.30% <0.00%> (ø)
module/zfs/vdev_initialize.c 97.46% <0.00%> (ø)
... and 46 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a42ef0...7938d03. Read the comment docs.

@behlendorf behlendorf merged commit 4a21ec0 into openzfs:master Apr 6, 2020
@ghost ghost deleted the zts-timestamp branch April 6, 2020 23:36
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
The delegate tests use `date(1)` to generate snapshot names, using
the format '%F-%T-%N' to get nanosecond resolution (since multiple
snapshots may be taken in the same second).  '%N' is not portable, and
causes tests to fail on FreeBSD.

Since the only purpose these timestamps serve is to create a unique
name, simply use $RANDOM instead.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes openzfs#10170
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: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants