From user-return-46556-archive-asf-public=cust-asf.ponee.io@jmeter.apache.org Mon Jan 15 11:08:01 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id E34F2180657 for ; Mon, 15 Jan 2018 11:08:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D1B6B160C31; Mon, 15 Jan 2018 10:08:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2114C160C25 for ; Mon, 15 Jan 2018 11:08:00 +0100 (CET) Received: (qmail 62739 invoked by uid 500); 15 Jan 2018 10:07:59 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 62728 invoked by uid 99); 15 Jan 2018 10:07:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jan 2018 10:07:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 5D777C5659 for ; Mon, 15 Jan 2018 10:07:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.29 X-Spam-Level: ** X-Spam-Status: No, score=2.29 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, KAM_NUMSUBJECT=0.5, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id gxnpzkzc_CGe for ; Mon, 15 Jan 2018 10:07:57 +0000 (UTC) Received: from internetallee.de (internetallee.de [81.169.162.220]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id B59045F22F for ; Mon, 15 Jan 2018 10:07:56 +0000 (UTC) Received: from [10.53.253.17] (x59cc9a11.dyn.telefonica.de [89.204.154.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by internetallee.de (Postfix) with ESMTPSA id 4A8F520A304A for ; Mon, 15 Jan 2018 11:07:55 +0100 (CET) Date: Mon, 15 Jan 2018 11:07:52 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Issue with javascript math function in Jmeter 3.3 To: JMeter Users List From: Felix Schumacher Message-ID: <32B4CE37-67FD-43DD-B95E-B4740CDD1557@internetallee.de> Am 15=2E Januar 2018 10:19:13 MEZ schrieb sebb : >On 15 January 2018 at 07:29, Felix Schumacher > wrote: >> >> >> Am 13=2E Januar 2018 22:32:01 MEZ schrieb Marcelo Jara >: >>>Hello, >>> >>> >>>I'm running into an issue with Jmeter 3=2E3=2E It seems the Math=2Efloo= r() >>>Javascript function is behaving differently when compared to older >>>versions such as 2=2E12=2E I've simplified the call below for this emai= l=2E >>> >>> >>>${__intSum(${__javaScript(Math=2Efloor(${667}/60))},${extra},)} > >${667} means to use the value of the variable called '667' > >Is that what you really meant? I supposed that this 667 was left by the simplification and used the value= directly in my tests=2E=20 Result seems to be the same=2E=20 Nashorn will give back a double and rhino an int=2E=20 Funny enough if I log the result of Math=2Efloor inside a Javascript jsr22= 3 sampler it logs an int value=2E=20 Another hack to get an int value inside of __javaScript is using __javaScript("" +Math=2Efloor(=2E=2E=2E)) Felix > >>> >>> >>> >>>667/60 =3D 11=2E1166 so the Math=2Efloor function should return 11= =2E >>>Instead it's returning the exception below=2E It seems Math=2Efloor is >not >>>evaluating to an Int=2E >> >> Try to set the property javascript=2Euse_rhino to true=2E >> >> And file a Bugzilla entry as this seems to be a regression we should >look at=2E >> >> Regards, >> Felix >> >>> >>> >>>2018-01-13 16:23:12,808 ERROR o=2Ea=2Ej=2EJMeter: Uncaught exception: >>>java=2Elang=2ENumberFormatException: For input string: "11=2E0" >>>at >>>java=2Elang=2ENumberFormatException=2EforInputString(NumberFormatExcept= ion=2Ejava:65) >>>~[?:1=2E8=2E0_152] >>> at java=2Elang=2EInteger=2EparseInt(Integer=2Ejava:580) >~[?:1=2E8=2E0_152] >>> at java=2Elang=2EInteger=2EparseInt(Integer=2Ejava:615) >~[?:1=2E8=2E0_152] >>>at org=2Eapache=2Ejmeter=2Efunctions=2EIntSum=2Eexecute(IntSum=2Ejava:6= 7) >>>~[ApacheJMeter_functions=2Ejar:3=2E3 r1808647] >>>at >>>org=2Eapache=2Ejmeter=2Eengine=2Eutil=2ECompoundVariable=2Eexecute(Comp= oundVariable=2Ejava:137) >>>~[ApacheJMeter_core=2Ejar:3=2E3 r1808647] >>>at >>>org=2Eapache=2Ejmeter=2Eengine=2Eutil=2ECompoundVariable=2Eexecute(Comp= oundVariable=2Ejava:112) >>>~[ApacheJMeter_core=2Ejar:3=2E3 r1808647] >>>at >>>org=2Eapache=2Ejmeter=2Etestelement=2Eproperty=2EFunctionProperty=2Eget= StringValue(FunctionProperty=2Ejava:101) >>>~[ApacheJMeter_core=2Ejar:3=2E3 r1808647] >>>at >>>org=2Eapache=2Ejmeter=2Etestelement=2Eproperty=2EAbstractProperty=2Eget= IntValue(AbstractProperty=2Ejava:108) >>>~[ApacheJMeter_core=2Ejar:3=2E3 r1808647] >>>at >>>org=2Eapache=2Ejmeter=2Etestelement=2EAbstractTestElement=2EgetProperty= AsInt(AbstractTestElement=2Ejava:238) >>>~[ApacheJMeter_core=2Ejar:3=2E3 r1808647] >>>at >>>org=2Eapache=2Ejmeter=2Ethreads=2EAbstractThreadGroup=2EgetNumThreads(A= bstractThreadGroup=2Ejava:209) >>>~[ApacheJMeter_core=2Ejar:3=2E3 r1808647] >>>at >>>org=2Eapache=2Ejmeter=2Eengine=2EStandardJMeterEngine=2EstartThreadGrou= p(StandardJMeterEngine=2Ejava:509) >>>~[ApacheJMeter_core=2Ejar:3=2E3 r1808647] >>>at >>>org=2Eapache=2Ejmeter=2Eengine=2EStandardJMeterEngine=2Erun(StandardJMe= terEngine=2Ejava:457) >>>~[ApacheJMeter_core=2Ejar:3=2E3 r1808647] >>> at java=2Elang=2EThread=2Erun(Thread=2Ejava:748) [?:1=2E8=2E0_1= 52] >>> >>> >>> >>> >>>Any suggestions? >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@jmeter=2Eapache=2Eorg >> For additional commands, e-mail: user-help@jmeter=2Eapache=2Eorg >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@jmeter=2Eapache=2Eorg >For additional commands, e-mail: user-help@jmeter=2Eapache=2Eorg --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org For additional commands, e-mail: user-help@jmeter.apache.org