# Command Line Execution Logic

**URL:** <https://forum.katalon.com/t/command-line-execution-logic/30285>\
**Category:** Bug Report\
**Tags:** bugs-report, katalon-studio\
**Created:** [July 25, 2019, 6:24pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285 "2019-07-25T18:24:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [July 25, 2019, 6:24pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/1 "2019-07-25T18:24:36Z")

</div>

I’m looking for clarification on the current logic behind command line execution. Looking at the console log, I see the following snippet:

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/2/2d8e76f290d0765449805fb61c531d1b0d8ff91c.png)

In particular, I’m concerned with the following lines:

```
Delete folder: bin
Delete folder: Libs

```

… after which the project is opened (triggering a recompile). Looking back a ways, I believe this approach may have been an attempt to resolve everyone’s favorite bug:

> [@Groovy Error: Unable to resolve class internal.GlobalVariable](http://forum.katalon.com/t/groovy-error-unable-to-resolve-class-internal-globalvariable/9557/150):
>
> While I haven’t followed this topic for a while (and there’s no way I have time to read through it again expressionless), I’d like to take a shot in the dark and share what worked for me way back in June of last year. I haven’t experienced this issue in any release since 5.5. In the file explorer, navigate to your project folder and delete the following items (no risk here, these will get re-built once you reopen the project in the Studio): Then, try downloading the latest release …

… where I make a suggestion to delete those directories, then reopen your project, allowing the studio to rebuild the workspace. However, _I never intended this to be a permanent solution_ to that problem so long ago, it was simply a quick fix to get people up and running.

There is a major problem with integrating this into console mode execution by default, and I believe it may be the source of several issues that have been brought up:

> [@Unable to resolve class internal.GlobalVariable (Again)](http://forum.katalon.com/t/unable-to-resolve-class-internal-globalvariable-again/23427/21):
>
> Thanks for that Brandon… It then goes on to crash out (not always in the same way). Most recent I have is the following – but note the complaint about “$” again – I thought we’d killed that thing few releases back. I guess it might just be a symptom, not a real cause… Project 'blah' opened joptsimple.IllegalOptionSpecificationException: $ is not a legal option characte r at joptsimple.ParserRules.ensureLegalOptionCharacter(ParserRules.java:77 ) at joptsimple.ParserRules.ensure…

> [@Loading Project and Katalon Studio is stuck at "Generating Global Variables"](http://forum.katalon.com/t/loading-project-and-katalon-studio-is-stuck-at-generating-global-variables/18669):
>
> I opened Katalon Studio today to continue making test cases and I was given a loading screen upon selecting my project where it hasn’t moved beyond “Generating Global Variables” Unsure what other information that I can provide, please let me know what I can add to better help determine what the issue is.

The problem I see most often is when **multiple executions are triggered simultaneously and/or relatively close together.** Consider the following scenario:

1.) An execution is triggered, during which the bin and Libs folders are deleted, and the studio then tries to open the project. While the project is opening, and the source code is being recompiled, there is a period of time where these directories (and the binaries they contain) are not available.

2.) Another execution is triggered while this recompilation is going on. Because those directories are in the process of being rebuilt, one of the following has a good chance of happening:

- An error is thrown during the second job stating that the directories cannot be deleted (either because they don’t exist, or they do exist but are locked by the first job).
- The timing is such that job 2 is able to delete the directories, but this causes job 1 to throw errors, usually related to missing classes.

**This issue can be easily recreated by simply triggering two CLI executions simultaneously.**

Again, I’m just looking for some insight on why console mode execution does this. In my humble opinion, deleting these folders then recompiling is not a very good solution, especially when multiple exections are triggered as I’ve shown. This is particularly troublesome with Jenkins integration, where multiple nightly jobs are often triggered together.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [July 25, 2019, 6:32pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/2 "2019-07-25T18:32:39Z")

</div>

Awesome diligence, @Brandon_Hein (and no, I don’t throw “awesome” around lightly).

I don’t know why (but I can guess[1]) the tool doesn’t take a complete snapshot of the source(s) and run them in an effective compile-free sandbox.

[1] Would significantly change the runtime resource use figures.

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [July 25, 2019, 7:01pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/3 "2019-07-25T19:01:32Z")

</div>

After further testing, this has the potential of causing a myriad if issues. @devalex88 @ThanhTo please please please review this issue! It’s extremely easy to reproduce…

Steps to reproduce:

1.) Open the CLI  
2.) Enter your console mode execution argument. Mine is:

katalon -noSplash -runMode=console -consoleLog -noExit -projectPath=“C:\projects\qa-katalon\master.prj” -retry=0 -testSuitePath=“Test Suites/bluekc/pc2/smoke/smoke” -executionProfile=“BlueKC-1” -browserType=“Chrome”

3.) As closely-together as possible, execute this twice.

Depending on the timing, there are tons of different outcomes. None of them good. Below are just a few that I’ve encountered.

**First test**

I was just able to reproduce this:

> [@Loading Project and Katalon Studio is stuck at "Generating Global Variables"](http://forum.katalon.com/t/loading-project-and-katalon-studio-is-stuck-at-generating-global-variables/18669):
>
> I opened Katalon Studio today to continue making test cases and I was given a loading screen upon selecting my project where it hasn’t moved beyond “Generating Global Variables” Unsure what other information that I can provide, please let me know what I can add to better help determine what the issue is.

The first execution gets hung up on “Parsing custom keywords…”. The second execution completed successfully.

**Second test**

The first execution produces the following error log:

[log.txt](https://europe1.discourse-cdn.com/katalon/original/2X/2/2c0c296cd65d088f9cba88f3680e1083b16e588e.txt) (13.0 KB)

The second execution completes successfully.

**Third test**

Same result as First test.

**Fourth test**

The first execution produces errors indicating unable to delete certain files/directories, as mentioned in my OP, then hangs.

[log.txt](https://europe1.discourse-cdn.com/katalon/original/2X/5/56010e745b12c03d2b5c4da819f6e3736f66d9c9.txt) (8.4 KB)

The second execution completes successfully.

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [July 26, 2019, 4:52am UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/4 "2019-07-26T04:52:00Z")

</div>

Hi @Brandon_Hein

Thank you for bringing up, this completely slipped my mind until now. Our development team is currently looking into it and will let you know !

Cheers !

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [August 12, 2019, 9:05am UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/5 "2019-08-12T09:05:31Z")

</div>

Thank you @Brandon_Hein,

Sharing the same source folder concurrently between different Katalon Studio processes is not supported at this moment. May I know the reason why you need this feature?

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [August 12, 2019, 3:16pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/6 "2019-08-12T15:16:02Z")

</div>

The main reason is stated in the OP:

> [@Brandon\_Hein](#):
>
> This is particularly troublesome with Jenkins integration, where multiple nightly jobs are often triggered together.

If multiple clients have nightly builds that either happen concurrently, or relatively closely together, then the test executions for these will almost certainly overlap at some point.

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [August 12, 2019, 5:04pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/7 "2019-08-12T17:04:57Z")

</div>

> [@Brandon\_Hein](#):
>
> This is particularly troublesome with Jenkins integration, where multiple nightly jobs are often triggered together.

this is particularly lack of knowledge about jenkins, and any CI. assign as many workers/agents to the master and any task will run, independent of each other. katalon is a standalone application

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [August 12, 2019, 5:07pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/8 "2019-08-12T17:07:01Z")

</div>

> [@Brandon\_Hein](#):
>
> If multiple clients have nightly builds that either happen concurrently, or relatively closely together, then the test executions for these will almost certainly overlap at some point.

that can happen only because poor planing

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [August 12, 2019, 5:31pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/9 "2019-08-12T17:31:14Z")

</div>

> [@Ibus](#):
>
> this is particularly lack of knowledge about jenkins, and any CI. assign as many workers/agents to the master and any task will run, independent of each other. katalon is a standalone application

Sure, if you have more than one agent machine to work with. What you assume is a lack of knowledge may just be a lack of resources.

> [@Ibus](#):
>
> > If multiple clients have nightly builds that either happen concurrently, or relatively closely together, then the test executions for these will almost certainly overlap at some point.
> 
> that can happen only because poor planing

Poor planning between the various project teams perhaps.

This isn’t primarily about CI though. The ability to share pre-compiled source code is not an extremely tall order in my mind.

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [August 12, 2019, 5:52pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/10 "2019-08-12T17:52:47Z")

</div>

why would somebody need to run two concurent instances, at the same time, on the ‘same’ machine? just for fun? user space isolation has been invented long time ago. in multiple forms. virtualization, containers and so on

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [August 12, 2019, 6:03pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/11 "2019-08-12T18:03:31Z")

</div>

I’ll take “just for fun?” for 1000, Alex.

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [August 11, 2020, 6:03pm UTC](https://forum.katalon.com/t/command-line-execution-logic/30285/12 "2020-08-11T18:03:36Z")

</div>

Closed on August 11, 2020, 6:03pm UTC

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
