[Groonga-commit] groonga/groonga at c4be11e [master] test grndb check: add a test for locked table case

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 25 15:10:54 JST 2016


Kouhei Sutou	2016-01-25 15:10:54 +0900 (Mon, 25 Jan 2016)

  New Revision: c4be11e4e52627c612131f05d4d8bb054f1ad957
  https://github.com/groonga/groonga/commit/c4be11e4e52627c612131f05d4d8bb054f1ad957

  Message:
    test grndb check: add a test for locked table case

  Modified files:
    test/command_line/suite/grndb/test_check.rb

  Modified: test/command_line/suite/grndb/test_check.rb (+11 -0)
===================================================================
--- test/command_line/suite/grndb/test_check.rb    2016-01-25 15:07:10 +0900 (b9e6088)
+++ test/command_line/suite/grndb/test_check.rb    2016-01-25 15:10:54 +0900 (e78d0c3)
@@ -11,4 +11,15 @@ class TestGrnDBCheck < GroongaTestCase
 Database is locked. It may be broken. Re-create the database.
     MESSAGE
   end
+
+  def test_locked_table
+    groonga("table_create", "Users", "TABLE_HASH_KEY", "ShortText")
+    groonga("lock_acquire", "Users")
+    error = assert_raise(CommandRunner::Error) do
+      grndb("check")
+    end
+    assert_equal(<<-MESSAGE, error.error_output)
+[Users] Table is locked. It may be broken. (1) Truncate the table (truncate Users) or clear lock of the table (lock_clear Users) and (2) load data again.
+    MESSAGE
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index