Test always times out, even when I just print hi

I’m stuck on Stage #ND9 of building Sqlite using Clojure.

My tests are always timing out, no errors, it just times out. Locally everything is running, even your_program.sh.


$ clj -M -m sqlite.core backup.db "select count(*) from project"
13

─────────────────────────────────────────────────
 
$ ./your_program.sh backup.db "select count(*) from project"

13

─────────────────────────────────────────────────
$ codecrafters submit
Submitting changes (commit: 36bb8c4)...

⚡ This is a turbo test run. https://codecrafters.io/turbo

Running tests on your code. Logs should appear shortly...

[compile] Compilation successful.

Debug = true

[tester::#ND9] Running tests for Stage #ND9 (Count rows in a table)
[tester::#ND9] Creating table 'strawberry' with 116 rows
[tester::#ND9] $ ./your_program.sh test.db "select count(*) from strawberry"
[tester::#ND9] timed out, test exceeded 10 seconds
[tester::#ND9] Test failed

View our article on debugging test failures: https://codecrafters.io/debug

To test if this was a problem with my program being too slow, I removed the logic to just print “hi” to the screen.

(ns sqlite.core
  (:gen-class)
  (:require [clojure.string :as str]
            [dot-commands.dbinfo :as dbinfo]
            [dot-commands.tables :as tables]
            [logic.read-bytes :as read-bytes]
            [sql.core :as sql-core]
))

(defn -main [& args]
  (if (not= (count args) 2)
    (do
      (println "Usage: <db-file-path> <command>")
      (System/exit 1)
    )
    (let [db-file-path (first args)
          command (str/lower-case (second args))
          contents (read-bytes/lazy-byte-seq db-file-path)]

      (cond
        (= command ".dbinfo") (dbinfo/run contents)
        (= command ".tables") (tables/run contents)

        ; just print hi and exit
        (str/starts-with? command "select") (println "hi") ;(sql-core/run contents command)

        :else (throw (ex-info "Not supported!" {:command command}))
      )
    )
  )
)

$ clj -M -m sqlite.core backup.db "select count(*) from project"
hi

─────────────────────────────────────────────────
$ ./your_program.sh backup.db "select count(*) from project"

hi

─────────────────────────────────────────────────

$ codecrafters submit
Submitting changes (commit: 1bb4824)...

⚡ This is a turbo test run. https://codecrafters.io/turbo

Running tests on your code. Logs should appear shortly...

[compile] Compilation successful.

Debug = true

[tester::#ND9] Running tests for Stage #ND9 (Count rows in a table)
[tester::#ND9] Creating table 'apple' with 152 rows
[tester::#ND9] $ ./your_program.sh test.db "select count(*) from apple"
[tester::#ND9] timed out, test exceeded 10 seconds
[tester::#ND9] Test failed

View our article on debugging test failures: https://codecrafters.io/debug

Hi, it ran and passed the tests now. Guess the issue was fixed, thanks!