Fix ThreadLocalReadAheadBufferTest to avoid FileNotFoundException when -Djava.io.tmpdir set to /tmp

patch by Isaac Reath; reviewed by Paulo Motta, Stefan Miklosovic for CASSANDRA-20819
This commit is contained in:
Isaac Reath 2025-08-06 13:29:45 -04:00 committed by Stefan Miklosovic
parent 902ef57fa3
commit 170bf57eac
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
1 changed files with 2 additions and 2 deletions

View File

@ -177,13 +177,13 @@ public class ThreadLocalReadAheadBufferTest implements WithQuickTheories
private static File writeFile(int seed, int length)
{
String fileName = JAVA_IO_TMPDIR.getString() + "data+" + length + ".bin";
String fileName = "data+" + length + ".bin";
byte[] dataChunk = new byte[4096 * 8];
java.util.Random random = new Random(seed);
int writtenData = 0;
File file = new File(fileName);
File file = new File(JAVA_IO_TMPDIR.getString(), fileName);
try (FileOutputStream fos = new FileOutputStream(file.toJavaIOFile()))
{
while (writtenData < length)