JackieTien97 opened a new pull request, #19052:
URL: https://github.com/apache/iotdb/pull/19052

   ## Description
   
   Some integration test classes were never executed by any CI workflow:
   
   1. **Sharded jobs drop classes that inherit their category.** The Windows 
jobs of
      `cluster-it-1c1d.yml` and `table-cluster-it-1c1d.yml` and the five 
sharded jobs of `pipe-it.yml`
      build `failsafe.includesFile` by grepping the source files for the 
category name. JUnit's
      `@Category` is `@Inherited`, so a subclass without its own annotation 
belongs to its parent's
      categories and the unsharded jobs run it. Its file never names the 
category, though, so it ends
      up in no shard. The Windows job of `cluster-it-1c1d.yml` therefore 
skipped seven classes that the
      Ubuntu job runs: `IoTDBAggregationByLevel2IT`, `IoTDBMaxBy2IT`, 
`IoTDBMaxBy3IT`,
      `IoTDBMaxByAlignedSeriesIT`, `IoTDBMinBy2IT`, `IoTDBMinBy3IT` and 
`IoTDBMinByAlignedSeriesIT`.
      The other sharded jobs have no such class today, but would silently skip 
the next one; for the
      pipe categories that means it would not run on pull requests at all.
   2. **Classes without a category never run.** Every test profile sets 
`groups`, so a class without
      an own or inherited `@Category` is never selected. Ten classes with test 
methods had none, and
      none of them ever had one.
   3. **Class names that failsafe does not pick up.** 
`integration-test/pom.xml` configures no
      `<includes>`, so only `IT*`, `*IT` and `*ITCase` classes run. 
`IoTDBActiveRegionScanIT2` and
      `IoTDBActiveRegionScanWithModsIT2` have a category but end in `IT2`, and
      `IoTDBTableViewAddColumnTest` has neither a category nor a matching name.
   
   ## Changes
   
   - **Shard lists** (all seven sharded jobs): distribute every class that 
failsafe picks up by default
     (`IT*`, `*IT`, `*ITCase`), as fully qualified names, and leave the 
category selection to the
     profile's `groups`. The list still goes through `failsafe.includesFile`, 
so the POM excludes keep
     applying. The step no longer contains a category name, and same-named 
classes in different
     packages can no longer collide.
   - **Categories**, following each package's neighbours (including 
`@RunWith(IoTDBTestRunner.class)`
     where they use it):
     - `DailyIT`: `IoTDBRegionMigrateWithCompressionRatioIT`, 
`IoTDBRegionMigrateWithLastEmptyDeletionIT`
       (in `pass/daily`, where every other class is `DailyIT`).
     - `LocalStandaloneIT` + `ClusterIT`: `IoTDBAlignedMemQueryIT`, 
`IoTDBLoadEncryptedTsFileIT`,
       `IoTDBDatabaseQuotaIT`, and the abstract `IoTDBClusterQuotaIT`, which 
covers
       `IoTDBClusterDeviceQuotaIT`, `IoTDBClusterMixQuotaIT` and 
`IoTDBClusterTimeSeriesQuotaIT`.
     - `TableLocalStandaloneIT` + `TableClusterIT`: 
`IoTDBTableViewQueryWithCachedDeviceIT`,
       `IoTDBTableViewAddColumnIT`, and `IoTDBSessionCompressedIT`, which only 
uses table sessions.
   - **Renames**: `IoTDBActiveRegionScanIT2` -> `IoTDBActiveRegionScan2IT`,
     `IoTDBActiveRegionScanWithModsIT2` -> `IoTDBActiveRegionScanWithMods2IT` 
(the usual `xxx2IT`
     form), and `IoTDBTableViewAddColumnTest` -> `IoTDBTableViewAddColumnIT`.
   - **Schema quota tests** (`IoTDBClusterQuotaIT` and subclasses), which 
failed once they ran:
     - A DataNode enforces the remaining quota that the ConfigNode sends with 
each heartbeat, and the
       ConfigNode computes it from the usage reported in earlier heartbeat 
responses, so a schema change
       takes up to two heartbeat rounds to take effect, and until then the 
quota can be too low after a
       deletion or too high after a creation. The tests waited a fixed 2 s, 
which is not enough:
       creations right after a deletion were still rejected. They also did not 
wait at all between
       `clearSchema()` and the next test method on the same cluster, so the 
second method of
       `IoTDBClusterMixQuotaIT` always failed in `@Before`.
     - They now wait three heartbeat intervals after each schema change, 
including after `clearSchema()`.
       Nothing exposes the remaining quota, so this cannot be a condition wait.
   - **`IoTDBSessionCompressedIT#testAllNull` / `#testAllNullColumn`** expected 
their insert to succeed.
     Since #18533 the Java client drops FIELD columns whose values are all 
null, so these table-model
     tablets reach the server without a FIELD column and are rejected with
     `507: No Field column present, please check the request` (the same 
rejection that
     `IoTDBSessionRelationalIT#insertNoFieldTest` asserts). The tests now 
assert that rejection;
     `testAllNull` still sends all-null TAG/ATTRIBUTE columns through RPC 
compression, which is what
     #16107 added these tests for.
   - **`IoTDBClusterMixQuotaIT#testClusterSchemaQuota2` is `@Ignore`d.** In a 
cluster with several
     DataNodes, its insert into `root.sg1.d4` auto-extends device template `t1` 
beyond the time series
     quota. `ClusterConfigTaskExecutor` sizes the quota check of a template 
extension by
     `getTemplateUsingNumber` of the *receiving* DataNode only, and skips it 
when that number is 0, so
     the check is skipped when the template's devices are on other DataNodes. 
With the waits fixed,
     the method passed all 6 executions on 1C1D (3 runs x 2 schema engine 
modes) and failed 3 of 6 on
     1C3D, always on that insert. This is a product bug and needs its own fix.
   
   ## Verification
   
   - **Which classes run.** A static model of the failsafe selection (own and 
inherited `@Category`,
     method-level categories, `@Ignore`, failsafe's default includes, the POM 
excludes and each
     profile's `groups`/`excludedGroups`) reproduces the class counts of CI run 
40642539299 (298
     `LocalStandaloneIT` classes on Ubuntu) and 40642539586 (255 
`TableLocalStandaloneIT` classes).
     On this branch it finds no class with tests that is left out by a missing 
category or a
     non-matching name.
   - **Shard lists.** I executed the literal "Build IT shard list" step of all 
seven jobs in Git Bash
     for shards 0/1/2. In every job the three lists are disjoint, and together 
they select exactly
     the unsharded set of the job's profile:
   
     | Job | Profile | Classes per shard | Unsharded |
     |---|---|---|---|
     | `cluster-it-1c1d` Windows | `SimpleIT` | 96 / 106 / 104 | 306 |
     | `table-cluster-it-1c1d` Windows | `TableSimpleIT` | 85 / 89 / 84 | 258 |
     | `dual-tree-auto-basic` | `MultiClusterIT2DualTreeAutoBasic` | 5 / 5 / 5 
| 15 |
     | `dual-tree-auto-enhanced` | `MultiClusterIT2DualTreeAutoEnhanced` | 3 / 
4 / 3 | 10 |
     | `dual-tree-manual` | `MultiClusterIT2DualTreeManual` | 4 / 4 / 4 | 12 |
     | `dual-table-manual-basic` | `MultiClusterIT2DualTableManualBasic` | 4 / 
5 / 5 | 14 |
     | `dual-table-manual-enhanced` | `MultiClusterIT2DualTableManualEnhanced` 
| 4 / 4 / 4 | 12 |
   
     The per-shard counts of the 1C1D jobs are a little less even than before 
(the Windows 1C1D
     shards had 97 / 98 / 96 classes plus the 7 skipped ones), because the 
classes are now spread
     without looking at their category.
   - **failsafe 3.2.2.** In a small project with the same failsafe 
configuration as
     `integration-test/pom.xml` (it also auto-selects the JUnit Platform 
provider), the union of the
     new shard lists ran exactly the classes of the unsharded run, including a 
subclass that only
     inherits its category and one whose category is only on an abstract 
parent. Listed classes
     under `**/subscription/it/**`, with the excluded category, or without a 
category did not run.
     The old grep-based list missed both inheriting classes.
   - **Newly enabled ITs**, run locally with the profile of each category they 
belong to (Windows 11,
     JDK 21, `-DintegrationTest.forkCount=2`):
   
     | Profile | Classes | Result |
     |---|---|---|
     | `SimpleIT` | the eight tree classes | 64 tests, 0 failures, 2 skipped 
(`testClusterSchemaQuota2`) |
     | `ClusterIT` | the eight tree classes | 64 tests, 0 failures, 2 skipped 
(`testClusterSchemaQuota2`) |
     | `TableSimpleIT` | the three table classes | 5 tests, 0 failures |
     | `TableClusterIT` | the three table classes | 5 tests, 0 failures |
     | `DailyIT` | the two region migration classes | 2 tests, 0 failures |
   
     The three cluster quota classes also passed three more runs on each of 
`SimpleIT` and `ClusterIT`
     (apart from `testClusterSchemaQuota2` on `ClusterIT`, described above).
   - Spotless and Checkstyle passed on `integration-test` in a clean build. RAT 
was skipped locally
     because of unrelated untracked files in my checkout; this PR adds no new 
files.
   
   ## Notes
   
   - master does not compile at the moment: #19030 changed the return type of
     `ConfigNodeProcedureEnv#pushSingleConsumerGroupOnDataNode` while #19019 
added callers of the old
     one. #19047 fixes it. I applied #19047 locally for the IT runs above; it 
is not part of this PR,
     so the CI of this PR needs #19047 to be merged first.
   - A check that fails when a test class has no effective category, has a name 
failsafe does not
     pick up, or falls out of the shard lists would catch these problems early. 
It is not part of
     this PR.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to