-
Notifications
You must be signed in to change notification settings - Fork 2
Testing
Tests that are made manually, with debug on, only local glassfish, looking all the operations are performed correctly. Clusterjsp application is used:
-
Start a new session. Clear all cookies in the browser and start a new session. The session is requested to be created (createSession) and it is locked while creation. Then the unlock and the save (always a save).
-
Update or refresh test. The session is located in internal map and returned. The lock and unlock operations are executed and finally a save (set or cas) is done. Since 0.3 no touch is done, so update or refresh perform a cas/set.
-
Test of session recover. Stop and start the domain. The session is not found locally so it is searched in couchbase. It is recovered, added to local map, locked and unlocked. Always saved cos it is just created again.
-
Session invalidation. Session is found locally, locked but then removed. The session is removed from couchbase and after that from the local pool. Glassfish checks expiration after the invalidation, here there is a race. It can happen to be completely deleted and it is searched again in couchbase and not found or it can be found locally (cos not yet completed the operation) but in NOT FOUND state (deleted).
-
Test with an invalidated session. After the deletion, push the browser back button and refresh. The session is searched both locally and in couchbase but not found. A new session is requested to be created (the rest of the process is exactly the same as 1).
-
Expiration time. Wait the session timeout (10 min in my examples), check the processExpires finally detects the session as expired, background locks it, checks it does not exists in couchbase, and deletes it from local pool.
-
Error in couchbase. Create a new session and then stop couchbase. Click the application to check the session is put in ERROR state and a exception is returned (sticky needs two clicks). Start again the couchbase server. Click the application again. The session should be read from couchbase inside the lock foreground (cos it is in ERROR), then a normal save is executed.
- Repeat the tests twice (sticky and non-sticky).
This tests are done with the web service client application after deploying the server in the two-instanced glassfish cluster. Check no errors are reported by the application or in the glassfish logs (no debug, just warn and error).
-
Blocking tests. One client thread but two children sharing the same session (locks and starvation in non-sticky, nothing special in sticky). Two tests with sleep of 100ms and 0 (no sleep, testing locking). In non-sticky it has to be seen long starvation from one child over the other and big variance.
java -cp . es.rickyepoderi.managertest.client.Test -b "http://192.168.122.21/manager-test/SessionTest?wsdl" -ci 1 -ct 2 -ci 1000 -ts 100/0 -d
-
Refresh/Updates tests. Just one client but doing a lot of refresh/updates (I have to change the manager test to manage Strings and not byte[] cos currently byte[] never refresh, always updates). No starvation or variance with 100ms, a bit with 0 (maybe still locked in the background save).
java -cp . es.rickyepoderi.managertest.client.Test -b "http://192.168.122.21/manager-test/SessionTest?wsdl" -ci 1 -ct 1 -ci 1000 -ts 100/0 -d
-
Create/Delete tests. Just one client but doing a lot of iterations of create and delete. Check no errors in glassfish logs.
java -cp . es.rickyepoderi.managertest.client.Test -b "http://192.168.122.21/manager-test/SessionTest?wsdl" -ci 1 -ct 1 -i 1000 -ci 5 -ts 100/0 -d
-
Performance tests. The one I usually do in the blog posts.
java -cp . es.rickyepoderi.managertest.client.Test -b "http://192.168.122.21/manager-test/SessionTest?wsdl" -t 16 -i 20 -ci 50 -ts 500 -a 1 -s 50
java -cp . es.rickyepoderi.managertest.client.Test -b "http://192.168.122.21/manager-test/SessionTest?wsdl" -t 16 -i 20 -ci 50 -ts 500 -a 4 -s 50
java -cp . es.rickyepoderi.managertest.client.Test -b "http://192.168.122.21/manager-test/SessionTest?wsdl" -t 16 -i 20 -ci 50 -ts 500 -a 20 -s 100
java -cp . es.rickyepoderi.managertest.client.Test -b "http://192.168.122.21/manager-test/SessionTest?wsdl" -t 16 -i 20 -ci 50 -ts 500 -a 20 -s 200
-
Remember to check sticky and non-sticky. Sticky should use 192.168.122.22 and non-sticky 192.168.122.21 in the wsdl definition.
How to install it?
Sticky vs Non-Sticky
[External atttibutes] (wiki/External-Attributes)
[JavaEE session listeners] (wiki/JavaEE-Session-Listeners)
[Compiling from github] (wiki/Compiling-from-github)
couchbase-manager-0.1
couchbase-manager-0.2
couchbase-manager-0.3
couchbase-manager-0.4
couchbase-manager-0.5