Skip to content

Optimize IoTDBRestServiceIT errorInsertRecords#17371

Open
HTHou wants to merge 3 commits intomasterfrom
optimize_IoTDBRestServiceIT_errorInsertRecords
Open

Optimize IoTDBRestServiceIT errorInsertRecords#17371
HTHou wants to merge 3 commits intomasterfrom
optimize_IoTDBRestServiceIT_errorInsertRecords

Conversation

@HTHou
Copy link
Copy Markdown
Contributor

@HTHou HTHou commented Mar 27, 2026

This pull request refactors the errorInsertRecords integration test in IoTDBRestServiceIT.java to simplify its setup and improve maintainability. The test now uses the shared EnvFactory environment instead of creating a custom SimpleEnv cluster, and the verification logic has been streamlined.

Test refactoring and simplification:

  • The errorInsertRecords test no longer creates and manages a separate SimpleEnv cluster; it now uses the shared EnvFactory environment for consistency and simplicity.
  • The test logic is updated to iterate over all data nodes from EnvFactory, sending error insert requests to each and verifying the count of inserted records matches the number of data nodes. [1] [2]
  • Removed the previous logic that stopped and restarted data nodes and checked for results after node failures, making the test less flaky and more focused.

Code cleanup:

  • Unused imports related to SimpleEnv, consensus factories, and ResultSetMetaData have been removed for clarity. [1] [2] [3]
  • The @Ignore annotation was removed, re-enabling the test.
  • Replaced Thread.sleep(1000) with TimeUnit.SECONDS.sleep(1) for improved readability and consistency.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.78%. Comparing base (3b02d32) to head (7c18b4a).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #17371   +/-   ##
=========================================
  Coverage     39.78%   39.78%           
  Complexity      312      312           
=========================================
  Files          5127     5127           
  Lines        346295   346311   +16     
  Branches      44100    44105    +5     
=========================================
+ Hits         137770   137780   +10     
- Misses       208525   208531    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant