SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Feb 2006
    Location
    pune
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    multiple threads to run testcases on 2-3 remotem/c

    I am trying to run a script on one system that farms test case execution out to a number of remote systems that are each running SilkTest agents. I am using the spawn command to start a separate thread responsible for executing a single test case on a remote client. When a client is done executing a test case, the main process detects this and spawns another thread to execute the next test case in the list. My problem is that execution seems to be very unstable with random errors like "Parent/Sibling halted due to exception" or "Agent returned an invalid response".

    Is anyone attempting to do anything of this sort by similar means? Or by other means? Please share experiences, frustrations, solutions, etc.

    thanks
    Jitendra

  2. #2
    Senior Member
    Join Date
    Apr 2006
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: multiple threads to run testcases on 2-3 remotem/c

    Do you use rendezvous command to synchronize thread execution? Also there may be troubles with connecting/disconnecting to remote machine.

  3. #3
    Junior Member
    Join Date
    Sep 2006
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: multiple threads to run testcases on 2-3 remot

    You are lucky man... in my case there is an infinit loop in the test case, so the main thread never returns to call the test to another machine...
    Is Silk Test really supported for concurrency?

  4. #4
    Senior Member
    Join Date
    Mar 2003
    Location
    Dublin, Ireland
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: multiple threads to run testcases on 2-3 remotem/c

    I have placed some code below for you to review. This worked for me great but this code is a few years old now so there might be a better way of doing now.

    <font class="small">Code:</font><hr /><pre>[+] main ()
    [ ] // INTEGER i
    [+] // for (i=0; i &lt; 20; i++)
    [ ] // ConnectMachines () //Insert the testcase required
    [ ]
    [ ]
    [+] list of string IsMachines = {...}
    [ ] "pspc017"
    [ ] // "pspc004"
    [ ] // "pspc028"
    [ ] // "opc043"
    [ ] "pspc010"
    [ ]
    [ ] HMACHINE hTargetMachine017
    [ ] //HMACHINE hTargetMachine004
    [ ] //HMACHINE hTargetMachine028
    [ ] //HMACHINE hTargetMachine043
    [ ] HMACHINE hTargetMachine010
    [ ]
    [ ]
    [ ] string sTargetMachine
    [ ]
    [ ] //connect to the remote agents
    [ ] hTargetMachine017 = Connect ("pspc017")
    [ ] // hTargetMachine004 = Connect ("pspc004")
    [ ] // hTargetMachine028 = Connect ("pspc028")
    [ ] // hTargetMachine043 = Connect ("opc043")
    [ ] hTargetMachine010 = Connect ("pspc010")
    [ ]
    [ ] ConnectMachines (IsMachines)
    [ ]
    [ ]
    [ ] DisconnectAll ()
    [ ]
    [ ]
    [ ]
    [+] multitestcase ConnectMachines (in list of string IsMachines)
    [ ]
    [ ] string sMachine
    [ ]
    [+] for each sMachine in IsMachines
    [ ] SetUpMachine (sMachine)
    [ ]
    [-] for each sMachine in IsMachines
    [+] spawn //connect to machines in list and run the CreateNewClientLoop () test
    [ ] SetMachine (sMachine)
    [ ] CreateNewClientLoop ()
    [ ] rendezvous //wait for the machines to come together again
    [+] spawn //connect to machines in list and run the SearchLoop () test
    [ ] SetMachine (sMachine)
    [ ] SearchLoop ()
    [ ] rendezvous //wait for the machines to come together again
    [ ]
    [ ]

    [ ]
    [ ]
    [+] testcase CreateNewClientLoop () appstate none
    [ ] //perform some actions here - this is just an example
    </pre><hr />

  5. #5
    Senior Member
    Join Date
    Mar 2003
    Location
    Dublin, Ireland
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: multiple threads to run testcases on 2-3 remotem/c

    Forgot to mention that you need to change some options as well. Go to Options/runtime options and then change the Network to TCP/IP and Agent Name to none (that is what I have here - it might be different for you). Also on each of the target machines you will need to change the agent options to TCP/IP. The port no is a default number so it might be different in your organisation.

  6. #6
    Apprentice
    Join Date
    Nov 2005
    Location
    Mumbai, India
    Posts
    31
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: multiple threads to run testcases on 2-3 remotem/c

    I find some flaws in this script:
    1. The threads will not be executed simultaneously since spwan is placed in the loop itself , that means one thread will execute CreateNewClientLoop() and rendezvous and the same thread will execute SearchLoop(). Please note that this time other machines have not executed first function i.e. CreateNewClientLoop(). And after completing the first executing this function next item in the loop will be processed for other machines. Is this the requirement in your test?
    You can write your same function as -

    [+] multitestcase ConnectMachines (in list of string IsMachines)
    [ ]
    [ ] string sMachine
    [ ]
    [+] do
    [+] for each sMachine in IsMachines
    [ ] SetUpMachine (sMachine)
    [ ]
    [-] for each sMachine in IsMachines
    [+] spawn //connect to machines in list and run the CreateNewClientLoop () test
    [ ] SetMachine (sMachine)
    [ ] CreateNewClientLoop ()
    [ ] rendezvous //wait for the machines to come together again
    [ ]
    [-] for each sMachine in IsMachines
    [+] spawn //connect to machines in list and run the CreateNewClientLoop () test
    [ ] SetMachine (sMachine)
    [ ] SearchLoop ()
    [ ] rendezvous //wait for the machines to come together again
    [+] except
    [ ] rendezvous //synchonize threads if any of them fails
    [ ]


    2. Use the do-except to handle errors by threads and rendezvous whenever one thread fails


    Regards,
    Girdhar

  7. #7
    Junior Member
    Join Date
    Dec 2005
    Location
    San Leandro
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: multiple threads to run testcases on 2-3 remotem/c

    Have you tried using parallel. You can call it from a plan file.

    testcase parallel ()appstate none
    [ ] STRING sTarget1 = "10.10.10.11" //// target's network name. SilkTest1
    [ ] STRING sTarget2 = "10.10.10.12" //// target's network name. SilkTest2
    [ ]
    [ ] connect (sTarget1)
    [ ] connect (sTarget2)

    [+] parallel
    [ ] {testcase 1} (sTarget1)
    [ ] {testcase 2} (sTarget2)

    [ ]
    [ ] Disconnect (sTarget1)
    [ ] Disconnect (sTarget2)

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 8.82%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:19 PM.

Copyright BetaSoft Inc.