Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
)

var testDirPathForRead string
var cacheDirPath string

////////////////////////////////////////////////////////////////////////
// Boilerplate
Expand All @@ -54,6 +55,7 @@ func (s *concurrentReadTest) SetupTest() {

func (s *concurrentReadTest) TearDownTest() {
setup.UnmountGCSFuse(setup.MntDir())
operations.RemoveDir(cacheDirPath)
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -205,7 +207,9 @@ func (s *concurrentReadTest) Test_ConcurrentSegmentReadsSharedHandle() {
}
}

func (s *concurrentReadTest) Test_ConcurrentReadPlusWrite() {
// Test_MultiThreadedWritePlusRead tests multiple threads doing write followed by read concurrently on different files.
// It creates 10 goroutines, each writing a 32 MiB file and then reading it sequentially.
func (s *concurrentReadTest) Test_MultiThreadedWritePlusRead() {
const (
fileSize = 32 * operations.OneMiB // 32 MiB file
numGoRoutines = 10 // Number of concurrent readers
Expand Down Expand Up @@ -269,9 +273,12 @@ func TestConcurrentRead(t *testing.T) {
return
}

cacheDirPath = fmt.Sprintf("/tmp/gcsfuse-file-cache-concurrent-read-%s", setup.GenerateRandomString(5))
cacheDirFlag := fmt.Sprintf("--cache-dir=%s", cacheDirPath)
// Define flag sets specific for concurrent read tests
flagsSet := [][]string{
{}, // For default read path.
{}, // For default read path.
{"--file-cache-cache-file-for-range-read=true", "--file-cache-enable-parallel-downloads=true", cacheDirFlag}, // For file cache path
{"--enable-buffered-read"}, // For Buffered read enabled.
}

Expand Down
Loading