Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-7370

Drop test tables in each test case in H2DynamicTableSelfTest

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.4
    • None
    • sql
    • None

    Description

      Failing test cases are leaving tables they've created which in turn causes subsequent test cases to report false failures, e.g. when the latter test case tries to create a table with the same name.

      It would be great for such tables tables to run down curtain and join the choir invisible in finally clause; an example:

          public void testInternalCreateExistingTable() throws Exception {
      +               try {
                          execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar," +
                              " \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) " +
                              "template=\"cache\"");
      
                          GridTestUtils.assertThrows(null, new Callable<Object>() {
                              @Override public Object call() throws Exception {
                                  execute("CREATE TABLE \"Person\" (\"id\" int, \"city\" varchar" +
                                      ", \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) " +
                                      "template=\"cache\"");
      
                                  return null;
                              }
                          }, IgniteSQLException.class, "Table already exists: Person");
      +               }
      +               finally {
      +                   execute("DROP TABLE \"Person\"");
      +               }
      ...
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            kirill.shirokov Kirill Shirokov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: