[PR #1186] [MERGED] Unify logic for seeding the server from a directory #1270

Closed
opened 2026-03-03 12:33:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/1186
Author: @fsouza
Created: 5/28/2023
Status: Merged
Merged: 5/28/2023
Merged by: @fsouza

Base: mainHead: unify-seeding


📝 Commits (1)

  • 05ec835 Unify logic for seeding the server from a directory

📊 Changes

4 files changed (+74 additions, -311 deletions)

View changed files

📝 fakestorage/server.go (+28 -3)
📝 fakestorage/server_test.go (+46 -2)
📝 main.go (+0 -72)
main_test.go (+0 -234)

📄 Description

This should fix the flaky test: both the main and the fakestorage packages would create that directory and delete it, and since package tests run in parallel, there was a race between deleting and running the tests for generateObjectsFromFiles. I'm surprise we only observe flakiness on Windows.

On top of fixing the test, this also reduces code duplication. One downside is that we lose an info log, but I'm not too moved by that.


🔄 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/fsouza/fake-gcs-server/pull/1186 **Author:** [@fsouza](https://github.com/fsouza) **Created:** 5/28/2023 **Status:** ✅ Merged **Merged:** 5/28/2023 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `unify-seeding` --- ### 📝 Commits (1) - [`05ec835`](https://github.com/fsouza/fake-gcs-server/commit/05ec8357f13714fe34334cb415ed8107ba475053) Unify logic for seeding the server from a directory ### 📊 Changes **4 files changed** (+74 additions, -311 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/server.go` (+28 -3) 📝 `fakestorage/server_test.go` (+46 -2) 📝 `main.go` (+0 -72) ➖ `main_test.go` (+0 -234) </details> ### 📄 Description This should fix the flaky test: both the main and the fakestorage packages would create that directory and delete it, and since package tests run in parallel, there was a race between deleting and running the tests for generateObjectsFromFiles. I'm surprise we only observe flakiness on Windows. On top of fixing the test, this also reduces code duplication. One downside is that we lose an info log, but I'm not too moved by that. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:33:50 +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/fake-gcs-server#1270
No description provided.