I understand in AS3, you can create a Native Process, and once that process is complete, you can get the exitCode from NativeProcessExitEvent, which is just the exit code that native process returned to the OS. Is there anyway to set the exit code for when the AIR application closes? We have one application triggering this AIR application, and it is waiting for an exit code from the AIR application.
I think your are looking for this function :
NativeApplication.nativeApplication.exit( 1 );
Where 1 is the exit code
Related
The scenario is very similar to this one https://github.com/DevExpress/testcafe/issues/6804
Scenario:
I'm running a set of tests using testcafe, in a folder, with concurrency 4:
UI clicks
UI navigation
File upload scenario
Assertions
The job runs in github actions, with self-runners (docker container with no limits set) in AWS, using a properly sized m5.2xlarge box.
All goes well, tests pass, but randomly the job fails with an elusive error:
2022-06-11T08:10:53.9599698Z 30 passed (4m 34s)
2022-06-11T08:10:54.2336015Z Error:
2022-06-11T08:10:56.2617307Z ##[error]Process completed with exit code 1.
testcafe version 1.17.1
node version 14.17.18
I've tested changing/resizing the EC2 runner but didn't help. There are no errors on infra side, just the exit code 1 w/ no other details.
Is anyone else having this issue or have any advice on troubleshooting it?
I am trying to run a Windows scheduler task using schtasks.exe in an SSIS job. The task will be called using the same ID as is used to execute the task. The task itself works; It is currently started manually after the SSIS job is done.
I've tried running a script on my own PC with a space in the name and this worked. All other settings are the same. The name of this task is "DWH Upload DEV" and it's location is set to "\".
I'm calling the script from an Execute Process Task block, using schtasks.exe as the executable (with the full file path of course) and /RUN /TN "DWH Upload DEV" as the arguments.
I have RequireFullFileName set to False, FailTaskIfReturnCodeIsNotSuccessValue set to True and SuccessValue and TimeOut to 0
I am receiving the following error: [Execute Process Task] Error: In Executing "[location]\schtasks.exe" "/RUN /TN "DWH Upload DEV"" at "", The process exit code was "1" while the expected was "0".
The part here that confuses me is the error being at seemingly nothing.
Thanks in advance for any help!
EDIT:
I can't run the program that is performed by the scheduler from SSIS itself, due to the program needing to be run by a specific user. The use of task scheduler is a workaround for this.
So, as it turned out, the task DID trigger but it didn't actually properly work (I later heard the task stopped working about an hour before I started working with it). The task can now properly be run by using the following settings:
Executable: C:\Windows\System32\schtasks.exe
Arguments: /RUN /TN "DWHUploadDEV" (the new version has no spaces in the name)
The rest of the settings is as normal.
I have a weird behaviour on my application using QSqlDatabase.
This is the simple code i'm using:
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL", QString::number(this->m_id));
db.setHostName(SERVER_DATABASE_DATABASE_HOST);
db.setDatabaseName(SERVER_DATABASE_DATABASE_NAME);
db.setUserName(SERVER_DATABASE_USERNAME);
db.setPassword(SERVER_DATABASE_PASSWORD);
if( !db.open() ){
...
}
...
This snippet of code is executed inside the run() method of a QRunnable and i have n(n~20) of those Task that run asynchronusly without problems(no duplicated db connections, the connections are removed, ecc..).
The problem is that, after a lot of iteration, the execution crash.
The crash is replicable but not deterministic.
I tryied to run the application in debug mode but the debugger, stop at the line where i call the db.open() function, whitout further information(no stack trace, no signal).
My system specification:
MySQL v5.7.17 (community edition)
Mac OSX 10.11.6
Qt 5.7.0
Any suggestion is very appreciated
How do you terminate a run in SBT without exiting?
I'm trying CTRL+C but it exits SBT. Is there a way to only exit the running application while keeping SBT open?
From sbt version 0.13.5 you can add to your build.sbt
cancelable in Global := true
It is defined as "Enables (true) or disables (false) the ability to interrupt task execution with CTRL+C." in the Keys definition
If you are using Scala 2.12.7+ you can also cancel the compilation with CTRL+C. Reference https://github.com/scala/scala/pull/6479
There are some bugs reported:
https://github.com/sbt/sbt/issues/1442
https://github.com/sbt/sbt/issues/1855
In the default configuration, your runs happen in the same JVM that sbt is running, so you can't easily kill them separately.
If you do your run in a separate, forked JVM, as described at Forking, then you can kill that JVM (by any means your operating system offers) without affecting sbt's JVM:
run / fork := true
I've found the following useful when I have control over the main loop of the application being run from sbt.
I tell sbt to fork when running the application (in build.sbt):
fork in run := true
I also tell sbt to forward stdin from the sbt shell to the application (in build.sbt):
connectInput in run := true
Finally, in the main thread of the application, I wait for end-of-file on stdin and then shutdown the JVM:
while (System.in.read() != -1) {}
logger.warn("Received end-of-file on stdin. Exiting")
// optional shutdown code here
System.exit(0)
Of course, you can use any thread to read stdin and shutdown, not just the main thread.
Finally, start sbt, optionally switch to the subproject you want to run, run.
Now, when you want to stop the process, close its stdin by typing CTRL-D in the sbt shell.
Consider using sbt-revolver. We use it in our company and it's really handy.
For what you're asking can be done with:
reStart
reStop
Without need to configure build.sbt file.
Your can use this plugin by adding:
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
To your project/plugins.sbt
(first-post)
i am having a problem with NativeProcess.isSupported.
its a simple app make in abobe flash publish in air 3.8 .exe. everything works great :)
< supportedProfiles> desktop extendedDesktop tv extendedTV < /supportedProfilessetup.>
NativeApplication.nativeApplication.startAtLogin = true //after install, app start auto with win
NativeProcess.isSupported
var file: File = File.applicationDirectory.resolvePath("PC_shutdown.exe") //after timer the pc shutdown
install the setup.exe file run in windows 8, thats work 100% of the time. (manual start)
as in code the app start with windows login (its work) but NativeProcess.isSupported is then false so shutdown.exe will not executed. but when i manual start the app NativeProcess.isSupported is true and .exe is executed.
first run is false > close app > restart then it's true??? i have no idea/logic.
thx
NativeProcess support only works when you package your AIR application as a bundle (i.e. you create a self contained application with a copy of Adobe Air). This is done by specifying the "-target bundle" flag OR "-target native" flag when running adt.
More info on adt bundle/native installer flags