Skip to content

Commit cca7243

Browse files
author
Noah Meyerhans
committed
Use a unique socket name per firecracker run
On occasion, bugs in tests have resulted in leaked firecracker processes. By specifying a test-specific socket name, we're easily able to identify which test leaked the process, which helps with debugging. Signed-off-by: Noah Meyerhans <[email protected]>
1 parent 214aa88 commit cca7243

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

machine_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func TestJailerMicroVMExecution(t *testing.T) {
140140
jailerFullRootPath := filepath.Join(jailerTestPath, "firecracker", id)
141141
os.MkdirAll(jailerTestPath, 0777)
142142

143-
socketPath := filepath.Join(jailerTestPath, "firecracker", "api.socket")
143+
socketPath := filepath.Join(jailerTestPath, "firecracker", "TestJailerMicroVMExecution.socket")
144144
logFifo := filepath.Join(testDataPath, "firecracker.log")
145145
metricsFifo := filepath.Join(testDataPath, "firecracker-metrics")
146146
defer func() {
@@ -257,7 +257,7 @@ func TestMicroVMExecution(t *testing.T) {
257257
var nCpus int64 = 2
258258
cpuTemplate := models.CPUTemplate(models.CPUTemplateT2)
259259
var memSz int64 = 256
260-
socketPath := filepath.Join(testDataPath, "firecracker.sock")
260+
socketPath := filepath.Join(testDataPath, "TestMicroVMExecution.sock")
261261
logFifo := filepath.Join(testDataPath, "firecracker.log")
262262
metricsFifo := filepath.Join(testDataPath, "firecracker-metrics")
263263
defer func() {
@@ -338,7 +338,7 @@ func TestMicroVMExecution(t *testing.T) {
338338
}
339339

340340
func TestStartVMM(t *testing.T) {
341-
socketPath := filepath.Join("testdata", "fc-start-vmm-test.sock")
341+
socketPath := filepath.Join("testdata", "TestStartVMM.sock")
342342
defer os.Remove(socketPath)
343343
cfg := Config{
344344
SocketPath: socketPath,
@@ -373,7 +373,7 @@ func TestStartVMM(t *testing.T) {
373373
}
374374

375375
func TestStartVMMOnce(t *testing.T) {
376-
socketPath := filepath.Join("testdata", "fc-start-vmm-test.sock")
376+
socketPath := filepath.Join("testdata", "TestStartVMMOnce.sock")
377377
defer os.Remove(socketPath)
378378

379379
cfg := Config{

0 commit comments

Comments
 (0)