Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-13385

Delegate utests index name creation to CQLTester.createIndex

    XMLWordPrintableJSON

Details

    Description

      Currently, many unit tests rely on CQLTester.createIndex to create indexes. The index name should be specified by the test itself, for example:

      createIndex("CREATE CUSTOM INDEX myindex ON %s(c) USING 'org.apache.cassandra.index.internal.CustomCassandraIndex'");
      

      Two different tests using the same index name can produce racy Index myindex already exists errors due to the asynchronicity of CQLTester.afterTest cleanup methods.

      It would be nice to modify CQLTester.createIndex to make it generate its own index names, as it is done by CQLTester.createTable:

      createIndex("CREATE CUSTOM INDEX %s ON %s(c) USING 'org.apache.cassandra.index.internal.CustomCassandraIndex'");
      

      Attachments

        Issue Links

          Activity

            People

              adelapena Andres de la Peña
              adelapena Andres de la Peña
              Andres de la Peña
              Benjamin Lerer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: