From 429d076008eda44591b6d4038e50a49976d91cd6 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 14 Nov 2025 04:24:16 +0100 Subject: [PATCH] Bump nim codex to prevent datastore lock when closing the Codex client --- codex/codex_test.go | 34 +++++++++++++++++++++++++++++++++- vendor/nim-codex | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/codex/codex_test.go b/codex/codex_test.go index 060a22e..15c6cc3 100644 --- a/codex/codex_test.go +++ b/codex/codex_test.go @@ -1,6 +1,8 @@ package codex -import "testing" +import ( + "testing" +) func TestCodexVersion(t *testing.T) { config := defaultConfigHelper(t) @@ -89,3 +91,33 @@ func TestStorageQuota(t *testing.T) { t.Fatal("expected codex node to be created") } } + +func TestCreateAndDestroyMultipleInstancesWithSameDatadir(t *testing.T) { + datadir := t.TempDir() + + config := Config{ + DataDir: datadir, + LogFormat: LogFormatNoColors, + MetricsEnabled: false, + BlockRetries: 5, + } + + for range 2 { + node, err := New(config) + if err != nil { + t.Fatalf("Failed to create Codex node: %v", err) + } + + if err := node.Start(); err != nil { + t.Fatalf("Failed to start Codex node: %v", err) + } + + if err := node.Stop(); err != nil { + t.Fatalf("Failed to stop Codex node: %v", err) + } + + if err := node.Destroy(); err != nil { + t.Fatalf("Failed to stop Codex node after restart: %v", err) + } + } +} diff --git a/vendor/nim-codex b/vendor/nim-codex index 5a227db..c80d44f 160000 --- a/vendor/nim-codex +++ b/vendor/nim-codex @@ -1 +1 @@ -Subproject commit 5a227dbb561672667c5c0285a417175b5004ddf7 +Subproject commit c80d44ff93057dd41e8ea3d55bef572eb503dfd2