diff --git a/system_tests/bold_challenge_protocol_test.go b/system_tests/bold_challenge_protocol_test.go index daea27e5a4..eb210e53fd 100644 --- a/system_tests/bold_challenge_protocol_test.go +++ b/system_tests/bold_challenge_protocol_test.go @@ -78,11 +78,13 @@ func TestChallengeProtocolBOLDStartStepChallenge(t *testing.T) { } func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOption) { - Require(t, os.RemoveAll("/tmp/good")) - Require(t, os.RemoveAll("/tmp/evil")) + goodDir, err := os.MkdirTemp("", "good_*") + Require(t, err) + evilDir, err := os.MkdirTemp("", "evil_*") + Require(t, err) t.Cleanup(func() { - Require(t, os.RemoveAll("/tmp/good")) - Require(t, os.RemoveAll("/tmp/evil")) + Require(t, os.RemoveAll(goodDir)) + Require(t, os.RemoveAll(evilDir)) }) ctx, cancelCtx := context.WithCancel(context.Background()) defer cancelCtx() @@ -216,9 +218,10 @@ func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOp l2stateprovider.Height(blockChallengeLeafHeight), &bold.StateProviderConfig{ ValidatorName: "good", - MachineLeavesCachePath: "/tmp/good", + MachineLeavesCachePath: goodDir, CheckBatchFinality: false, }, + goodDir, ) Require(t, err) @@ -228,9 +231,10 @@ func testChallengeProtocolBOLD(t *testing.T, spawnerOpts ...server_arb.SpawnerOp l2stateprovider.Height(blockChallengeLeafHeight), &bold.StateProviderConfig{ ValidatorName: "evil", - MachineLeavesCachePath: "/tmp/evil", + MachineLeavesCachePath: evilDir, CheckBatchFinality: false, }, + evilDir, ) Require(t, err) diff --git a/system_tests/bold_new_challenge_test.go b/system_tests/bold_new_challenge_test.go index a9caec45f0..1363f700c1 100644 --- a/system_tests/bold_new_challenge_test.go +++ b/system_tests/bold_new_challenge_test.go @@ -277,15 +277,17 @@ func startBoldChallengeManager(t *testing.T, ctx context.Context, builder *NodeB var stateManager BoldStateProviderInterface var err error + cacheDir := t.TempDir() stateManager, err = bold.NewBOLDStateProvider( node.ConsensusNode.BlockValidator, node.ConsensusNode.StatelessBlockValidator, l2stateprovider.Height(blockChallengeLeafHeight), &bold.StateProviderConfig{ ValidatorName: addressName, - MachineLeavesCachePath: t.TempDir(), + MachineLeavesCachePath: cacheDir, CheckBatchFinality: false, }, + cacheDir, ) Require(t, err) diff --git a/system_tests/bold_state_provider_test.go b/system_tests/bold_state_provider_test.go index 17fa436a83..0ecce5ba64 100644 --- a/system_tests/bold_state_provider_test.go +++ b/system_tests/bold_state_provider_test.go @@ -400,15 +400,17 @@ func setupBoldStateProvider(t *testing.T, ctx context.Context, blockChallengeHei Require(t, blockValidator.Initialize(ctx)) Require(t, blockValidator.Start(ctx)) + dir := t.TempDir() stateManager, err := bold.NewBOLDStateProvider( blockValidator, stateless, l2stateprovider.Height(blockChallengeHeight), &bold.StateProviderConfig{ ValidatorName: "", - MachineLeavesCachePath: t.TempDir(), + MachineLeavesCachePath: dir, CheckBatchFinality: false, }, + dir, ) Require(t, err)