Skip to content

feat: enhance load testing with increased user and friendship counts#2321

Merged
robfrank merged 8 commits intomainfrom
test/0000-long-run-tests
Jun 30, 2025
Merged

feat: enhance load testing with increased user and friendship counts#2321
robfrank merged 8 commits intomainfrom
test/0000-long-run-tests

Conversation

@robfrank
Copy link
Collaborator

This pull request introduces significant updates to performance tests and supporting utilities for the ArcadeDB project. Key changes include the addition of new test classes, enhancements to existing load tests, optimizations in database interaction, and updates to container configurations for improved memory and threading capabilities.

New Test Classes

  • Added SingleLocalhostServerSimpleLoadTestIT to test load scenarios with a single server using a fixed-size thread pool for parallel operations. Includes metrics logging and assertions for user, photo, and friendship counts.
  • Added SingleServerSimpleLoadTestIT, a simplified load test class using TestContainers for containerized server testing. Similar logic to the localhost test but tailored for container-based environments.

Enhancements to Load Tests

  • Updated SingleServerLoadTestIT to increase the scale of load testing by modifying parameters: numOfUsers, numOfPhotos, and numOfFriendship. Simplified friendship creation logic by removing iterations and using a single parameter. [1] [2]

Optimizations in Database Interaction

  • Enhanced DatabaseWrapper:
    • Added a timeout of 30 seconds for remote database connections.
    • Improved error handling in addUserAndPhotos by enabling transaction rollback and logging errors with stack traces.
    • Simplified friendship creation logic by introducing UserIdSupplier, which fetches user IDs in batches for efficient processing. [1] [2]
    • Modified addFriendship to use ResultSet for edge creation commands.

Updates to Container Configuration

  • Increased httpsIoThreads from 10 to 30 for better concurrency handling.
  • Added ARCADEDB_OPTS_MEMORY environment variable to allocate 16GB of memory for containerized servers.

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

@robfrank robfrank requested a review from lvca June 30, 2025 13:20
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the ArcadeDB project's performance testing capabilities by introducing new test classes, scaling existing load tests, optimizing database interactions, and updating container configurations to improve memory and threading capabilities. These changes aim to provide a more robust and scalable testing environment.

Highlights

  • New Test Classes: Added SingleLocalhostServerSimpleLoadTestIT and SingleServerSimpleLoadTestIT to test load scenarios with single servers, using fixed-size thread pools and TestContainers respectively. These include metrics logging and assertions for user, photo, and friendship counts.
  • Load Test Enhancements: Updated SingleServerLoadTestIT to increase load testing scale by modifying numOfUsers, numOfPhotos, and numOfFriendship parameters. Simplified friendship creation logic.
  • Database Interaction Optimizations: Enhanced DatabaseWrapper with a 30-second timeout for remote connections, improved error handling with transaction rollback and stack trace logging in addUserAndPhotos, and simplified friendship creation using UserIdSupplier for efficient user ID fetching. Modified addFriendship to use ResultSet for edge creation commands.
  • Container Configuration Updates: Increased httpsIoThreads from 10 to 30 for better concurrency handling and added ARCADEDB_OPTS_MEMORY to allocate 16GB of memory for containerized servers.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances performance testing capabilities by increasing the scale of load tests and adding new test scenarios. I've provided feedback focusing on a critical fix to remove a System.exit(1) call from a test utility and to correct hardcoded passwords.

Comment on lines +134 to +135
e.printStackTrace();
System.exit(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

Calling System.exit(1) within a test utility is a critical issue. It will terminate the entire JVM, preventing the test suite from completing and generating proper reports. Failures in tests should be handled by throwing exceptions, which the test framework can catch and report.

Additionally, e.printStackTrace() should be avoided in favor of logging frameworks. The logger call should include the exception object to log the full stack trace.

Suggested change
e.printStackTrace();
System.exit(1);
logger.error("Error creating user {}: {}", userId, e.getMessage(), e);
throw new RuntimeException("Failed to create user " + userId, e);

2480,
DATABASE,
"root",
"pippopluto");
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The password pippopluto is hardcoded and appears to be incorrect. The setup instructions in SingleLocalhostServerSimpleLoadTestIT specify using playwithdata as the root password. This mismatch will likely cause authentication failures.

Please use the correct password and consider defining it as a constant to improve maintainability and avoid such inconsistencies.

RemoteServer server = new RemoteServer("localhost",
2480,
"root",
"pippopluto");
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The password pippopluto is hardcoded here and appears to be incorrect. The setup instructions in SingleLocalhostServerSimpleLoadTestIT specify using playwithdata as the root password. This mismatch will likely cause authentication failures when creating the database.

Please use the correct password and consider defining it as a constant to improve maintainability and avoid such inconsistencies.

@codacy-production
Copy link

codacy-production bot commented Jun 30, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.23% 83.33%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (b70abd2) 70452 45125 64.05%
Head commit (a2b9b19) 70487 (+35) 45308 (+183) 64.28% (+0.23%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2321) 54 45 83.33%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@robfrank robfrank merged commit 68e9359 into main Jun 30, 2025
14 of 18 checks passed
robfrank added a commit that referenced this pull request Jul 3, 2025
Co-authored-by: lvca <lvca@users.noreply.github.com>
(cherry picked from commit 68e9359)
@robfrank robfrank deleted the test/0000-long-run-tests branch January 14, 2026 16:05
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