From 683c8d597f3570c3c5bacead331298c7925b6bce Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 24 Nov 2025 22:42:24 -0500 Subject: fix(task): ensure thread safety and isolate tests Re-introduces MVar locking in Task Core to prevent race conditions during Read-Modify-Write cycles (e.g. ID generation). Updates tests to use isolated SQLite databases instead of the production DB or JSONL files. Removes legacy test artifacts. Amp-Thread-ID: https://ampcode.com/threads/T-ac41b9b6-d117-46de-9e4f-842887a22f1d Co-authored-by: Amp --- Omni/Task.hs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'Omni/Task.hs') diff --git a/Omni/Task.hs b/Omni/Task.hs index 85314ad..13fc63c 100644 --- a/Omni/Task.hs +++ b/Omni/Task.hs @@ -400,7 +400,7 @@ unitTests = setEnv "TASK_TEST_MODE" "1" -- Clean up test database before all tests - let testFile = ".tasks/tasks-test.jsonl" + let testFile = ".tasks/tasks-test.db" exists <- doesFileExist testFile when exists <| removeFile testFile initTaskDb @@ -774,11 +774,6 @@ cliTests = Right args -> do args `Cli.has` Cli.command "show" Test.@?= True args `Cli.has` Cli.longOption "json" Test.@?= True, - Test.unit "sync command" <| do - let result = Docopt.parseArgs help ["sync"] - case result of - Left err -> Test.assertFailure <| "Failed to parse 'sync': " <> show err - Right args -> args `Cli.has` Cli.command "sync" Test.@?= True, Test.unit "stats command" <| do let result = Docopt.parseArgs help ["stats"] case result of -- cgit v1.2.3