How is the HDL simulation timeout specified when using OpenCPI? - simulation

My simulation fails to stop until an inbuilt timeout is reached. The default is 3600 seconds. How do I set this to a different time period?
The openCPI version is 2.4.3.
Any suggestions?
This is my first use of OpenCPI.

You can change the default timeout for tests using the Timeout attribute in the Tests element of your test XML like below:
<Tests UseHdlFileIO="true" Timeout="30">
<Case>
<!-- Inputs and Outputs in here -->
</Case>
</Tests>
The timeout is defined in seconds. More information can be found in section 13.3.5 of the OpenCPI Component Development Guide

Related

ignore.synchronization=true/ browser.waitforAngularEnabled(true) takes so long when compared to browser.sleep()

While executing e2e tests in protractor when we are using ignore.synchronization=true/ browser.waitforAngularEnabled(true) to handle waits is too slow when compared to browser.sleep(10000) to proceed to next step. How to address these kind of wait issues to make the script execution faster?
Difference:
ignore.synchronization=true/ browser.waitforAngularEnabled(true) are used to make protractor wait until all the angular modules are loaded.
browser.sleep(// time in ms) is raw way of stopping the protractor for the given particular ms.
Solution:
To handle wait issues:
use browser.waitforAngularEnabled(false) after getting your base url. Then you can use expected waits which makes the protractor wait until that expectation is completed.
Refer https://www.protractortest.org/#/api?view=ProtractorExpectedConditions for more details
Hope it helps you

OperationTimeout /WriteTimeOut on Await Duration.Inf

I am looking at some code where data is written to cassandra using
Await.result(casDB.store(someVal), Duration.Inf)
I am seeing OperationTimeoutException and WriteTimeoutException. Say if we had 5 seconds timeout and server didnt respond within 5 second then i can think of these exception. But when duration is set to Inf not able to understand what is the reason for these exception.
There is a configuration named reference.conf in the akka.jar. The default timeout for akka is 5 seconds.
So you should create a new configuration and named it application.conf. set actor->typed->timeout = 3000s

Setting a global timeout in Ember-cli for Qunit

I cannot find anywhere that it is documented for ember-cli to set a global timeout for QUnit.
I have found the documentation for QUnit:
https://api.qunitjs.com/QUnit.config/
testTimeout (default: undefined)
Type: Number
Specify a global timeout in milliseconds after which all tests will fail with an appropriate message. Useful when async tests aren't finishing, to prevent the testrunner getting stuck. Set to something high, e.g. 30000 (30 seconds) to avoid slow tests to time out by accident.
I was able to change this inside of \node_modules\ember-cli-qunit\vendor\ember-cli-qunit\qunit-configuration.js and this works as expected.
However, we do not check in the node_modules to source control, so changing this value here doesn't really do me any good.
I'm at a loss here on where I'm supposed to make a change to get a global test timeout in ember-cli.
This can be done within the //tests/test-helper.js file.
QUnit.config.testTimeout = 60000;
In tests.index.html
right after the line that says:
<script src="assets/test-support.js"></script>
Add:
<script>
QUnit.config.testTimeout = 6400; // Why not 6400? This is a nice number
</script>

How is delay of the akka scheduler?

I wrote an actor, using a scheduler each 5 milliseconds to assign a time stamp to a field.
And in test, I found that the result of (System.currentTimeMillis() - timeField) is at least 35
And if I use a scheduleAtFixedRate() method from the Executors.scheduledThreadPool, the result is right.
So is the scheduler delay has a min value ?
Answer: the default tick duration is 100 milliseconds.
ScheduledThreadPoolExecutor uses System.nanoTime():
http://fuseyism.com/classpath/doc/java/util/concurrent/ScheduledThreadPoolExecutor-source.html
See comparison here:
System.currentTimeMillis vs System.nanoTime
Akka has a fairly extensive documentation.
Here's an excerpt:
"The default implementation of Scheduler used by Akka is based on the Netty HashedWheelTimer. It does not execute tasks at the exact time, but on every tick, it will run everything that is overdue. The accuracy of the default Scheduler can be modified by the “ticks-per-wheel” and “tick-duration” configuration properties. For more information, see: HashedWheelTimers."

Quartz.Net - delay a simple trigger to start

I have a few jobs setup in Quartz to run at set intervals. The problem is though that when the service starts it tries to start all the jobs at once... is there a way to add a delay to each job using the .xml config?
Here are 2 job trigger examples:
<simple>
<name>ProductSaleInTrigger</name>
<group>Jobs</group>
<description>Triggers the ProductSaleIn job</description>
<misfire-instruction>SmartPolicy</misfire-instruction>
<volatile>false</volatile>
<job-name>ProductSaleIn</job-name>
<job-group>Jobs</job-group>
<repeat-count>RepeatIndefinitely</repeat-count>
<repeat-interval>86400000</repeat-interval>
</simple>
<simple>
<name>CustomersOutTrigger</name>
<group>Jobs</group>
<description>Triggers the CustomersOut job</description>
<misfire-instruction>SmartPolicy</misfire-instruction>
<volatile>false</volatile>
<job-name>CustomersOut</job-name>
<job-group>Jobs</job-group>
<repeat-count>RepeatIndefinitely</repeat-count>
<repeat-interval>43200000</repeat-interval>
</simple>
As you see there are 2 triggers, the first repeats every day, the next repeats twice a day.
My issue is that I want either the first or second job to start a few minutes after the other... (because they are both in the end, accessing the same API and I don't want to overload the request)
Is there a repeat-delay or priority property? I can't find any documentation saying so..
I know you are doing this via XML but in code you can set the StartTimeUtc to delay say 30 seconds like this...
trigger.StartTimeUtc = DateTime.UtcNow.AddSeconds(30);
This isn't exactly a perfect answer for your XML file - but via code you can use the StartAt extension method when building your trigger.
/* calculate the next time you want your job to run - in this case top of the next hour */
var hourFromNow = DateTime.UtcNow.AddHours(1);
var topOfNextHour = new DateTime(hourFromNow.Year, hourFromNow.Month, hourFromNow.Day, hourFromNow.Hour, 0, 0);
/* build your trigger and call 'StartAt' */
TriggerBuilder.Create().WithIdentity("Delayed Job").WithSimpleSchedule(x => x.WithIntervalInSeconds(60).RepeatForever()).StartAt(new DateTimeOffset(topOfNextHour))
You've probably already seen this by now, but it's possible to chain jobs, though it's not supported out of the box.
http://quartznet.sourceforge.net/faq.html#howtochainjobs