[PR #2784] [MERGED] Changed to urandom instead of potentially conflicting RANDOM environment variable #2787

Closed
opened 2026-03-04 02:07:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2784
Author: @ggtakec
Created: 1/11/2026
Status: Merged
Merged: 1/12/2026
Merged by: @gaul

Base: masterHead: improve/testfile


📝 Commits (1)

  • c4c1d39 Changed to urandom instead of potentially conflicting RANDOM environment variable

📊 Changes

1 file changed (+12 additions, -5 deletions)

View changed files

📝 test/test-utils.sh (+12 -5)

📄 Description

Relevant Issue (if applicable)

#2782

Details

Recently, we've been experiencing a lot of failures in GHA runs, such as test_update_time_touch and test_update_time_mv, etc.
I discovered that this was due to conflicting RANDOM environment variables.
Surprisingly(or perhaps not surprisingly), conflicts with RANDOM environment variables seem to be occurring more frequently than expected.

For example, in the test_update_time_touch test, the following line failed because the stat for the ${TEST_TEXT_FILE} file could not be obtained:

echo data | s3_cp "${TEST_BUCKET_1}/${OBJECT_NAME}" --header "x-amz-meta-atime: ${t0}" --header "x-amz-meta-ctime: ${t0}" --header "x-amz-meta-mtime: ${t0}"
local base_atime; base_atime=$(get_atime "${TEST_TEXT_FILE}")

Below is the actual test log(only the relevant part is excerpted):

test_hardlink: "Testing hardlinks ..."
...
[INF] s3fs.cpp:s3fs_getattr(919): [path=/testrun-16117/test-s3fs-27208.txt][pid=9897,uid=0,gid=0]
...
[INF]       cache.cpp:AddNegativeStat(264): add negative cache entry[path=/testrun-16117/test-s3fs-27208.txt]
...
...
test_update_time_append: "Testing update time function append..."
...
[INF] s3fs.cpp:s3fs_getattr(919): [path=/testrun-16117/test-s3fs-27208.txt][pid=10112,uid=0,gid=0]
...
stat: cannot statx 'test-s3fs-27208.txt': No such file or directory

This result means the same test file name was used in both test_hardlink and test_update_time_append.
As a result, the target file was accumulated in the NegativeCache during the earlier test_hardlink process, and the file could not be detected in the next test.

To fix this, I increased the number of additional characters(16bit to 32bit) added to the file name.
(I wanted to use /dev/urandom, but when we did this, the test would not start, and the reason for this was unknown. Therefore, I used $RANDOM to double the number of characters.)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/2784 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 1/11/2026 **Status:** ✅ Merged **Merged:** 1/12/2026 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `improve/testfile` --- ### 📝 Commits (1) - [`c4c1d39`](https://github.com/s3fs-fuse/s3fs-fuse/commit/c4c1d39a4cc032d0837054fc49f2eb0a21ac7896) Changed to urandom instead of potentially conflicting RANDOM environment variable ### 📊 Changes **1 file changed** (+12 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `test/test-utils.sh` (+12 -5) </details> ### 📄 Description ### Relevant Issue (if applicable) #2782 ### Details Recently, we've been experiencing a lot of failures in GHA runs, such as `test_update_time_touch` and `test_update_time_mv`, etc. I discovered that this was due to conflicting `RANDOM` environment variables. Surprisingly(or perhaps not surprisingly), conflicts with `RANDOM` environment variables seem to be occurring more frequently than expected. For example, in the `test_update_time_touch` test, the following line failed because the stat for the `${TEST_TEXT_FILE}` file could not be obtained: ``` echo data | s3_cp "${TEST_BUCKET_1}/${OBJECT_NAME}" --header "x-amz-meta-atime: ${t0}" --header "x-amz-meta-ctime: ${t0}" --header "x-amz-meta-mtime: ${t0}" local base_atime; base_atime=$(get_atime "${TEST_TEXT_FILE}") ``` Below is the actual test log(only the relevant part is excerpted): ``` test_hardlink: "Testing hardlinks ..." ... [INF] s3fs.cpp:s3fs_getattr(919): [path=/testrun-16117/test-s3fs-27208.txt][pid=9897,uid=0,gid=0] ... [INF] cache.cpp:AddNegativeStat(264): add negative cache entry[path=/testrun-16117/test-s3fs-27208.txt] ... ... test_update_time_append: "Testing update time function append..." ... [INF] s3fs.cpp:s3fs_getattr(919): [path=/testrun-16117/test-s3fs-27208.txt][pid=10112,uid=0,gid=0] ... stat: cannot statx 'test-s3fs-27208.txt': No such file or directory ``` This result means the same test file name was used in both `test_hardlink` and `test_update_time_append`. As a result, the target file was accumulated in the `NegativeCache` during the earlier `test_hardlink` process, and the file could not be detected in the next test. To fix this, I increased the number of additional characters(16bit to 32bit) added to the file name. _(I wanted to use `/dev/urandom`, but when we did this, the test would not start, and the reason for this was unknown. Therefore, I used `$RANDOM` to double the number of characters.)_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:07:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#2787
No description provided.