Skip to content

Commit

Permalink
Attempt to stabilize OPC UA chunk factory tests.
Browse files Browse the repository at this point in the history
Related to #1764.

Signed-off-by: Łukasz Dywicki <[email protected]>
  • Loading branch information
splatch committed Oct 14, 2024
1 parent 44a267c commit 80b83ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

public class ChunkFactory {

public static int SYMMETRIC_SECURITY_HEADER_SIZE = 4;
public static final int ASYMMETRIC_SECURITY_HEADER_SIZE = 59;
public static final int SYMMETRIC_SECURITY_HEADER_SIZE = 4;

public Chunk create(boolean asymmetric, Conversation conversation) {
return create(asymmetric,
Expand All @@ -48,7 +49,7 @@ public Chunk create(boolean asymmetric, boolean encrypted, boolean signed, Secur

if (securityPolicy == SecurityPolicy.NONE) {
return new Chunk(
asymmetric ? 59 : SYMMETRIC_SECURITY_HEADER_SIZE,
asymmetric ? ASYMMETRIC_SECURITY_HEADER_SIZE : SYMMETRIC_SECURITY_HEADER_SIZE,
1,
1,
securityPolicy.getSymmetricSignatureSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.plc4x.java.opcua.TestCertificateGenerator;
import org.apache.plc4x.java.opcua.readwrite.MessageSecurityMode;
import org.apache.plc4x.java.opcua.readwrite.OpcuaProtocolLimits;
Expand All @@ -40,7 +41,7 @@
@Disabled("Disabled flaky test. Tracking issue at https://github.com/apache/plc4x/issues/1764")
class ChunkFactoryTest {

public static final Map<Integer, Entry<PrivateKey, X509Certificate>> CERTIFICATES = new HashMap<>();
public static final Map<Integer, Entry<PrivateKey, X509Certificate>> CERTIFICATES = new ConcurrentHashMap<>();

private OpcuaProtocolLimits limits = new OpcuaProtocolLimits(
8196,
Expand Down

0 comments on commit 80b83ca

Please sign in to comment.