 
             (test-msg-handler new-facts-cmd publish discard-dir
               (reset! second-message? true)
+              (is (= 1 (count @failures)))
               (is (re-matches
                    #"(?sm).*ERROR: could not serialize access due to concurrent update.*"
-                   (extract-error-message publish))))
+                   (full-sql-exception-msg (first @failures)))))
             @fut
             (is (true? @first-message?))
             (is (true? @second-message?))))))))

                                 :timestamp (-> 2 days ago)
                                 :environment nil
                                 :producer_timestamp (-> 2 days ago)
                                 :producer "bar.com"}))

        (with-redefs [scf-store/update-facts!
                      (fn [fact-data]
                        (.put hand-off-queue "got the lock")
                        (.poll hand-off-queue 5 TimeUnit/SECONDS)

            [puppetlabs.puppetdb.testutils
             :refer [args-supplied call-counter dotestseq times-called]]
            [puppetlabs.puppetdb.jdbc :refer [query-to-vec] :as jdbc]
            [puppetlabs.puppetdb.jdbc-test :refer [full-sql-exception-msg]]
            [puppetlabs.puppetdb.examples :refer :all]
            [puppetlabs.puppetdb.testutils.services :as svc-utils]
            [puppetlabs.puppetdb.command.constants :refer [command-names]]
