summaryrefslogtreecommitdiff
path: root/Omni/Task.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-11-24 22:42:24 -0500
committerBen Sima <ben@bensima.com>2025-11-24 22:42:24 -0500
commit683c8d597f3570c3c5bacead331298c7925b6bce (patch)
tree9699319ddf453bcf3d616b86d0f3c69e035adf3a /Omni/Task.hs
parent05b36fd8799cbd18febc8f46b3780cc330c4fff9 (diff)
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 <amp@ampcode.com>
Diffstat (limited to 'Omni/Task.hs')
-rw-r--r--Omni/Task.hs7
1 files changed, 1 insertions, 6 deletions
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