Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BB98A18851 for ; Fri, 18 Dec 2015 08:33:37 +0000 (UTC) Received: (qmail 80749 invoked by uid 500); 18 Dec 2015 08:33:37 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 80695 invoked by uid 500); 18 Dec 2015 08:33:37 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 80682 invoked by uid 99); 18 Dec 2015 08:33:37 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Dec 2015 08:33:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B706C1804B0 for ; Fri, 18 Dec 2015 08:33:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id mTCUdQisAPbA for ; Fri, 18 Dec 2015 08:33:35 +0000 (UTC) Received: from zill.ext.symas.net (zill.ext.symas.net [69.43.206.106]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id EB90B21157 for ; Fri, 18 Dec 2015 08:33:34 +0000 (UTC) Received: from lfbn-1-4146-141.w92-169.abo.wanadoo.fr ([92.169.142.141] helo=[192.168.1.29]) by zill.ext.symas.net with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1a9qTf-0005BG-7r for dev@directory.apache.org; Fri, 18 Dec 2015 00:33:27 -0800 To: Apache Directory Developers List From: =?UTF-8?Q?Emmanuel_L=c3=a9charny?= Subject: Random errors in tests X-Enigmail-Draft-Status: N1110 Message-ID: <5673C4D4.6090602@symas.com> Date: Fri, 18 Dec 2015 09:33:24 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi guys, I'm sure you have already experienced this issue. From time to time (not frequently), when running integration tests, I get such an error : testComplexNotRefinement(org.apache.directory.server.core.subtree.RefinementEvaluatorTest) Time elapsed: 0.016 sec <<< ERROR! org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException: The 'objectClass' AttributeType and values must both be String or binary at org.apache.directory.api.ldap.model.entry.AbstractValue.apply(AbstractValue.java:166) at org.apache.directory.api.ldap.model.entry.BinaryValue.(BinaryValue.java:111) at org.apache.directory.api.ldap.model.entry.DefaultAttribute.createBinaryValue(DefaultAttribute.java:107) at org.apache.directory.api.ldap.model.entry.DefaultAttribute.add(DefaultAttribute.java:1150) at org.apache.directory.api.ldap.model.entry.DefaultAttribute.(DefaultAttribute.java:300) at org.apache.directory.api.ldap.model.entry.DefaultAttribute.(DefaultAttribute.java:273) at org.apache.directory.server.core.subtree.RefinementEvaluatorTest.testComplexNotRefinement(RefinementEvaluatorTest.java:239) I don't think we should freak out, as this problems pretty much boils down to a static variable being initialized many times in tests that are run concurrently : @RunWith(ConcurrentJunitRunner.class) @Concurrency() public class RefinementEvaluatorTest ... private static AttributeType OBJECT_CLASS_AT; ... @BeforeClass public static void init() throws Exception { ... OBJECT_CLASS_AT = schemaManager.getAttributeType( "objectClass" ); ... At this point, we can fix that by making this variable non static and initialize it in a @Before method instead of doing so in a @Before class. Otherwise, the root cause is that we do this check : boolean isHR = attributeType.getSyntax().isHumanReadable(); if ( isHR != isHumanReadable() ) { String message = "The '" + attributeType.getName() + "' AttributeType and values must " + "both be String or binary"; LOG.error( message ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message ); } and it's perfectly plausible that between the initialization of the isHr variable and the test, we have a new initialization of the attributeType, resetting the isHr flag. Just wznted to let you know...