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

ISPN-9819 Listeners correction in spring session #6534

Merged
merged 2 commits into from Dec 24, 2018

Conversation

karesti
Copy link
Contributor

@karesti karesti commented Dec 12, 2018

@gustavocoding gustavocoding self-assigned this Dec 12, 2018
Copy link
Member

@wburns wburns left a comment

Choose a reason for hiding this comment

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

To completely finalize this I think we still need to add a test checking that a session attribute is available to a registered listener.

Also I would say we should probably verify that embedded works in a clustered environment and confirm that the event is propagated to even non owner nodes.

@karesti
Copy link
Contributor Author

karesti commented Dec 12, 2018

@wburns Ok for the tests you mentioned

@karesti
Copy link
Contributor Author

karesti commented Dec 13, 2018

I will squash all the commits in the end

@karesti
Copy link
Contributor Author

karesti commented Dec 13, 2018

@wburns I've been working on the tests, and it's too much effort today to spend more time testing from spring that the listeners are indeed clustered in embedded. Same applies to checking a value inside the httpsession. I added a test to check that the events are raised and that contain a non null http session inside. Which is the original problem that was fixed from spring session and now from our side as well.

@karesti
Copy link
Contributor Author

karesti commented Dec 13, 2018

@wburns concerning integration tests, they are missing, globally speaking, on spring/spring-boot. But I would add those tests in the spring-boot starter, where we do provide nice support for spring-boot, instead of infinispan repository. I have already an issue for that. Spring session integration tests are missing there, and others too

@karesti
Copy link
Contributor Author

karesti commented Dec 13, 2018

@gustavonalle @wburns failed tests unrelated

@danberindei
Copy link
Member

@karesti I just noticed @wburns's comment, and he's right that we should check a session attribute in the test to see that it's a full session and not a dummy one.

Please also rename callEviction to processExpiration, and configure the cache managers with a ControlledTimeService so that the test doesn't have to sleep for 1 second.

@karesti
Copy link
Contributor Author

karesti commented Dec 19, 2018

@danberindei I added a test to check that we have a session that it's not null. If the underlying session object exists - not null - it is not a dummy session but the session. This is how spring session is working now

@karesti
Copy link
Contributor Author

karesti commented Dec 19, 2018

@danberindei as I said before, these kind of tests are good to test with spring boot and all the spring boot mechanisms. The starter is the good place to put these tests, instead of the spring integration tests in infinispan code base (older tests, before the starter existed)

@danberindei
Copy link
Member

@karesti I didn't mean to add a new test, but testEventBridge already checks that the number of emitted events is correct, so I was thinking it could be amended to set an attribute in the session then check that it's there in the event as well.

I prefer putting tests as close to the code they're testing as possible. If we only had tests in the starter we could make a breaking change in core, then we'd modify the spring integration to compile and push to master, and we'd only see a failure in the starter test suite much later.

@karesti
Copy link
Contributor Author

karesti commented Dec 20, 2018

@danberindei hi, tell me what you think, before merge I have to squash

element = new byte[length];
buffer.get(element);
} catch (Exception ex) {

Copy link
Member

Choose a reason for hiding this comment

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

I missed this... we should at least log the error if something went wrong

Copy link
Member

Choose a reason for hiding this comment

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

Actually logging is probably best left to ClientListenerInvocation... here we should return null if buffer.remaining() == 0, but otherwise we should assume the buffer contains a full element.

Copy link
Member

Choose a reason for hiding this comment

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

I pushed a commit to check the size to your branch @karesti
Test suite looks good locally but I'll wait for CI to confirm

@karesti
Copy link
Contributor Author

karesti commented Dec 21, 2018

Test failure is unrelated.
Backport PR is here #6535

@danberindei danberindei merged commit 1d2b3f0 into infinispan:master Dec 24, 2018
@danberindei
Copy link
Member

Integrated, thanks Katia!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants