-
- Downloads
Fixes the formatting (#45308)
Before ==== ``` 2024-07-04 15:54:39,084 INFO metabase.server :: Shutting Down Embedded Jetty Webserver Exception in thread "Thread-9" java.util.IllegalFormatConversionException: f != java.lang.Long 2024-07-04 15:54:39,122 WARN db.liquibase :: (#object[liquibase.Liquibase 0x2b7e6614 liquibase.Liquibase@2b7e6614]) at java.base/java.util.Formatter$FormatSpecifier.failConversion(Unknown Source) at java.base/java.util.Formatter$FormatSpecifier.printFloat(Unknown Source) at java.base/java.util.Formatter$FormatSpecifier.print(Unknown Source) at java.base/java.util.Formatter.format(Unknown Source) at java.base/java.util.Formatter.format(Unknown Source) at java.base/java.lang.String.format(Unknown Source) at clojure.core$format.invokeStatic(core.clj:5770) at clojure.core$format.doInvoke(core.clj:5764) at clojure.lang.RestFn.invoke(RestFn.java:423) at metabase.db.liquibase$wait_for_all_locks.invokeStatic(liquibase.clj:258) at metabase.db.liquibase$wait_for_all_locks.invoke(liquibase.clj:251) at metabase.db.setup$release_migration_locks_BANG_.invokeStatic(setup.clj:175) at metabase.db.setup$release_migration_locks_BANG_.invoke(setup.clj:170) at metabase.db$release_migration_locks_BANG_.invokeStatic(db.clj:91) at metabase.db$release_migration_locks_BANG_.invoke(db.clj:86) at metabase.core$destroy_BANG_.invokeStatic(core.clj:90) at metabase.core$destroy_BANG_.invoke(core.clj:81) at clojure.lang.AFn.run(AFn.java:22) at java.base/java.lang.Thread.run(Unknown Source) ``` And now it will correctly log ``` 2024-07-09 16:04:28,345 INFO db.liquibase :: Waiting for migration lock(s) to be released (max 0.4 secs) ``` Why no tests? ==== There _is_ a test that would have caught this. And in fact running at the repl will catch it: ```clojure liquibase=> (do (require 'clojure.test 'metabase.db.liquibase-test) (clojure.test/run-test metabase.db.liquibase-test/wait-for-all-locks-test)) Testing metabase.db.liquibase-test ERROR in (wait-for-all-locks-test) (Formatter.java:4515) :h2 Will timeout if a lock is not released expected: (= :timed-out (liquibase/wait-for-all-locks sleep-ms timeout-ms)) actual: java.util.IllegalFormatConversionException: f != clojure.lang.Ratio ``` But this _passes_ in CI: ``` ❯ clj -X:dev:test :only metabase.db.liquibase-test/wait-for-all-locks-test Finding tests took 23.5 s. Running 1 tests Running before-run hooks... Ran 1 tests in 1.461 seconds 3 assertions, 0 failures, 0 errors. {:test 1, :pass 3, :fail 0, :error 0, :type :summary, :duration 1461.175042, :single-threaded 1} Ran 0 tests in parallel, 1 single-threaded. Finding and running tests took 25.0 s. All tests passed. Running after-run hooks... ``` And that's because the log level in testing is FATAL and this is an INFO level log. Discussed ways to improve this like adding a null logger during CI but we aren't ready to increase CI times for that just yet.
Please register or sign in to comment