This is an automated email from the ASF dual-hosted git repository.
benw pushed a commit to branch TAP5-2799
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
The following commit(s) were added to refs/heads/TAP5-2799 by this push:
new 22bfff581 TAP5-2799: Adapt SessionImplTests to locking changes
22bfff581 is described below
commit 22bfff581b8500f0c9269cd61e11f8c79968df64
Author: Ben Weidig <[email protected]>
AuthorDate: Sun Feb 2 11:51:06 2025 +0100
TAP5-2799: Adapt SessionImplTests to locking changes
---
.../org/apache/tapestry5/internal/services/SessionImplTest.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/SessionImplTest.java
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/SessionImplTest.java
index dbc622052..48da0a5ec 100644
---
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/SessionImplTest.java
+++
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/SessionImplTest.java
@@ -254,6 +254,13 @@ public class SessionImplTest extends InternalBaseTestCase
Object dirty = new Object();
SessionLock lock = mockLock();
+ // TAP5-2799: To reduce write locks, first, a read-lock attempt is done
+ // to check if the attribute exists, and only then, a write-lock is
acquired.
+
+ lock.acquireReadLock();
+
+
expect(hs.getAttributeNames()).andReturn(Collections.enumeration(Arrays.asList("dirty")));
+
lock.acquireWriteLock();
train_getAttribute(hs, "dirty", dirty);