Skip to content

test(framework): stabilize test fixtures and fix resource leaks#6664

Closed
bladehan1 wants to merge 5 commits intotronprotocol:developfrom
bladehan1:feat/opt_test
Closed

test(framework): stabilize test fixtures and fix resource leaks#6664
bladehan1 wants to merge 5 commits intotronprotocol:developfrom
bladehan1:feat/opt_test

Conversation

@bladehan1
Copy link
Copy Markdown
Collaborator

Summary

  • Fix iterator resource leaks in DBIteratorTest by properly closing iterators
  • Merge duplicate CredentialsTest coverage from keystroe (typo package) into keystore
  • Stabilize CredentialsTest fixtures with dynamic temp file generation
  • Update iterator exception assertions to match actual behavior

Test plan

  • ./gradlew :framework:test --tests "org.tron.core.db.DBIteratorTest"
  • ./gradlew :framework:test --tests "org.tron.keystore.CredentialsTest"
  • Verify removed duplicate org.tron.keystroe.CredentialsTest has no unique coverage

🤖 Generated with Claude Code

bladehan1 and others added 5 commits April 3, 2026 16:59
change RocksDB iterator exception checks to use Assert.assertThrows for clearer intent and stricter failure behavior when expected exceptions are not thrown.
Consolidate the misplaced keystroe CredentialsTest into org.tron.keystore.CredentialsTest.

- remove the duplicate test under the misspelled keystroe package
- add explicit equals behavior coverage for address and cryptoEngine
- normalize assertions to JUnit Assert and remove legacy TestCase usage
Replace random Credentials test setup with deterministic SignInterface mocks
so the suite no longer depends on platform-specific SecureRandom providers or
probabilistic retries.

- remove NativePRNG usage from CredentialsTest
- replace random key generation with fixed address fixtures via mocked SignInterface
- assert create(SignInterface) returns the expected base58check address
- keep equals/hashCode contract coverage with deterministic inputs
@github-actions github-actions bot requested review from 317787106 and xxo1shine April 9, 2026 04:47
@bladehan1 bladehan1 closed this Apr 9, 2026
@bladehan1 bladehan1 reopened this Apr 9, 2026
@bladehan1
Copy link
Copy Markdown
Collaborator Author

only for Ci test

@bladehan1 bladehan1 closed this Apr 9, 2026
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.

2 participants