Skip to content

[issues-93] - WildFly + remote Infinispan distributed timers test#94

Open
fabiobrz wants to merge 1 commit intoIntersmash:mainfrom
fabiobrz:issues-93
Open

[issues-93] - WildFly + remote Infinispan distributed timers test#94
fabiobrz wants to merge 1 commit intoIntersmash:mainfrom
fabiobrz:issues-93

Conversation

@fabiobrz
Copy link
Copy Markdown
Member

Description

Adding the WildFly + Infinispan distributed timers tests.

Resolves #93, and relates to:

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • Pull Request contains a description of the changes
  • Pull Request does not include fixes for multiple issues/topics
  • Code is self-descriptive and/or documented
  • I tested my code in OpenShift

@fabiobrz fabiobrz changed the title [issues-93] - WildFLy + remote Infinispan distributed timers test [issues-93] - WildFly + remote Infinispan distributed timers test Mar 26, 2026

// Set the build input
buildInput = new BuildInputBuilder()
// TODO: fix before merging!!! We have two aplications and 2 PRs for this test, but just one property
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fabiobrz this is just a thread to remind ourselves to replace this

environmentVariables.add(
new EnvVarBuilder()
.withName("POSTGRESQL_DATABASE")
.withValue("theData")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fabiobrz these user, password and database config:

		environmentVariables.add(
				new EnvVarBuilder()
						.withName("POSTGRESQL_DATABASE")
						.withValue("theData")
						.build());
		environmentVariables.add(
				new EnvVarBuilder()
						.withName("POSTGRESQL_USER")
						.withValue("theUser")
						.build());
		environmentVariables.add(
				new EnvVarBuilder()
						.withName("POSTGRESQL_PASSWORD")
						.withValue("thePassword")
						.build());

should come from some constant value in PostgresqlTimerExpirationStoreApplication:

		parameters.put("POSTGRESQL_USER", "theUser");
		parameters.put("POSTGRESQL_PASSWORD", "thePassword");
		parameters.put("POSTGRESQL_DATABASE", "theData");

--> I suggest adding constants in PostgresqlTimerExpirationStoreApplication and referencing them in WildFlyTimerExpirationStoreApplication

.statusCode(HttpStatus.SC_OK);
}

private void cancelTimer(final String applicationInfo) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fabiobrz just a suggestion: looks like the two cancleTimer functions have a lot in common and might perhaps further refactored:

Image


private void giveTheTimerEnoughTimeToExecuteOnce(final Long waitInterval, final String applicationInfo) {
SimpleWaiter waiter = new SimpleWaiter(
() -> retrieveExpirations(applicationInfo).size() > 0,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fabiobrz perhaps we can use !retrieveExpirations(applicationInfo).isEmpty() here

}

@Override
public boolean equals(Object o) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fabiobrz id not included

}

@Override
public int hashCode() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fabiobrz id not included

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.

Test WildFly/JBoss EAP distributed timers with Infinispan

2 participants