Skip to content

Commit 01b9d60

Browse files
committed
Fix MessageBufferInputTest flake: mkdirs() before createTempFile
saveToTmpFile called File.createTempFile("testbuf", ".dat", new File("target")) before tmp.getParentFile.mkdirs() — createTempFile requires the parent directory to already exist, so under occasional filesystem timing in CI sandboxes this threw "No such file or directory" before the directory got created. Surfaced while validating the sbt 2 migration's CI matrix; unrelated to sbt 2 itself, but was intermittently failing the JDK8 test lane via fail-fast cancellation of the rest of the matrix.
1 parent 226c8ff commit 01b9d60

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

msgpack-core/src/test/scala/org/msgpack/core/buffer/MessageBufferInputTest.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ class MessageBufferInputTest extends AirSpec:
5858
def toByteBuffer = ByteBuffer.wrap(b)
5959

6060
def saveToTmpFile: File =
61-
val tmp = File.createTempFile("testbuf", ".dat", new File("target"))
62-
tmp.getParentFile.mkdirs()
61+
val dir = new File("target")
62+
dir.mkdirs()
63+
val tmp = File.createTempFile("testbuf", ".dat", dir)
6364
tmp.deleteOnExit()
6465
withResource(new FileOutputStream(tmp)) { out =>
6566
out.write(b)

0 commit comments

Comments
 (0)