Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMWK-69 Fix condition timeout and improve tests #442

Merged
merged 8 commits into from
Oct 20, 2022

Conversation

roimenashe
Copy link
Member

@roimenashe roimenashe commented Oct 18, 2022

  1. Use count() that are not as-info based in tests (which doesn't exclude deleted record that wasn't removed yet).
  2. Reduce redundant code executions - use BeforeAll() instead of BeforeEach() when possible.
  3. Remove blockhound for inactivity (latest version release was on April 2021) - it is also complicates our build and tests.
  4. Refactor test operations (reactive and non-reactive).

…set (using count() and as-info command behind the scenes).

2. Refactor test operations (reactive and non-reactive).
@roimenashe roimenashe added the bug label Oct 18, 2022
@roimenashe roimenashe requested review from Aloren and reugn October 18, 2022 09:32
@roimenashe roimenashe self-assigned this Oct 18, 2022
protected boolean isEntityClassSetEmpty(Class<?> clazz) {
Long count = template.count(clazz).block();
if (count != null) {
return count == 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 is int

Suggested change
return count == 0;
return count == 0L;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test for it

Copy link
Member Author

@roimenashe roimenashe Oct 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's completely internal infrastructure for our test flow, just replaced it with different logic (basically a scan and count) because template.count takes too much time due to Aerospike internal delete mechanism which doesn't actually removes the records - only removes the entry from the PK.

Check latest commit.

@roimenashe
Copy link
Member Author

Do not merge yet - working on improving the test flow (currently takes 15min to complete).

…ead of excluding the objects that was marked for deletion.

It takes time for template.count(clazz) to reach 0 after truncate.

Revert duration limit back to 10 sec.
… 2021) and it complicates our build and tests.

2. Refactor tests - use BeforeAll over BeforeEach when possible (logically) to reduce tests total execution time.
@roimenashe roimenashe changed the title FMWK-69 Fix condition timeout in tests FMWK-69 Fix condition timeout and improve tests Oct 18, 2022
…-timeouts-in-tests

# Conflicts:
#	src/test/java/org/springframework/data/aerospike/core/AerospikeTemplateCountTests.java
#	src/test/java/org/springframework/data/aerospike/core/AerospikeTemplateFindByQueryTests.java
#	src/test/java/org/springframework/data/aerospike/core/reactive/ReactiveAerospikeTemplateCountRelatedTests.java
#	src/test/java/org/springframework/data/aerospike/core/reactive/ReactiveAerospikeTemplateFindByQueryTests.java
#	src/test/java/org/springframework/data/aerospike/query/QualifierTests.java
#	src/test/java/org/springframework/data/aerospike/query/reactive/ReactiveQualifierTests.java
#	src/test/java/org/springframework/data/aerospike/repository/PersonRepositoryQueryTests.java
@roimenashe roimenashe merged commit 8cbaad3 into main Oct 20, 2022
@roimenashe roimenashe deleted the FMWK-69-fix-condition-timeouts-in-tests branch October 20, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants