bazelbuild / bazelbuild/rules_pkg

//tests:stamp_test inputs become stale too quickly

Open
#489 5 comments 0 reactions 0 assignees View on GitHub
bug help wanted P3 tests
Dominant language
Starlark
Stars
253
Forks
221
Avg merge
10h 33m
Merged PRs (30d)
1

Description

I often test all of `rules_pkg` using something like `bazelisk test //...`.

When I leave my desk for the day and come back the following day, I sometimes see `//tests:stamp_test` mysteriously fail after making some changes. This is due to the timestamps no longer being valid:

```
Traceback (most recent call last):
File "/private/var/tmp/_bazel_apsaltis/67ca5e5a723760c2131afe9d288ecae5/sandbox/darwin-sandbox/9/execroot/rules_pkg/bazel-out/darwin-fastbuild/bin/tests/stamp_test.runfiles/rules_pkg/tests/stamp_test.py", line 104, in test_not_epoch_times_tar
self.assertTarFilesAreAlmostNew('stamped_tar.tar')
File "/private/var/tmp/_bazel_apsaltis/67ca5e5a723760c2131afe9d288ecae5/sandbox/darwin-sandbox/9/execroot/rules_pkg/bazel-out/darwin-fastbuild/bin/tests/stamp_test.runfiles/rules_pkg/tests/stamp_test.py", line 82, in assertTarFilesAreAlmostNew
self.check_mtime(info.mtime, file_path, info.name)
File "/private/var/tmp/_bazel_apsaltis/67ca5e5a723760c2131afe9d288ecae5/sandbox/darwin-sandbox/9/execroot/rules_pkg/bazel-out/darwin-fastbuild/bin/tests/stamp_test.runfiles/rules_pkg/tests/stamp_test.py", line 63, in check_mtime
self.fail(
AssertionError: Archive /private/var/tmp/_bazel_apsaltis/67ca5e5a723760c2131afe9d288ecae5/sandbox/darwin-sandbox/9/execroot/rules_pkg/bazel-out/darwin-fastbuild/bin/tests/stamp_test.runfiles/rules_pkg/tests/stamped_tar.tar contains file . with mtime:1639538959, expected:1639586337 +/- 10000
```

It would be nice if the relevant artifacts could be rebuilt when they have expired in the cache. I don't know how implement this, though.

This problem is never seen in CI, since it builds everything from scratch all the time.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.