2

I am trying to use nohup to run tcltest script overnight. However, the tcltest seems to disable nohup's function and always terminate my tcltest process after I close the shell.

Example,

[root@demo test]# cat 0199.test

    package require tcltest
    namespace import ::tcltest::*
    test Dummy {} -body {
            for { set i 1 } { $i < 3000 } { incr i } {
                    puts "round $i"
                    after 5000
            }
    } -result 0
    cleanupTests

[root@demo test]# cat all_test.sh

    #!/usr/bin/expect -f
    package require tcltest
    namespace import ::tcltest::*
    runAllTests

[root@demo test]# cat nohup.out

    Tests running in interp:  /usr/bin/tclsh
    Tests located in:  /root/autotest/branches/2.3/test_suites/300_Cocktail/test
    Tests running in:  /root/autotest/branches/2.3/test_suites/300_Cocktail/test
    Temporary files stored in /root/autotest/branches/2.3/test_suites/300_Cocktail/test
    Test files run in separate interpreters
    Running tests that match:  *
    Skipping test files that match:  l.*.test
    Only running test files that match:  *.test
    Tests began at Tue Sep 10 14:49:36 CST 2013
    0199.test
    round 1
    round 2
    round 3
    round 4
    round 5
    round 6
    round 7
    Test file error: child killed: hangup

    Tests ended at Tue Sep 10 14:50:11 CST 2013
    all_test.sh:    Total   0       Passed  0       Skipped 0       Failed  0
    Sourced 1 Test Files.

    Test files exiting with errors:

    0199.test
  • This is a problem with your shell/your nohup. The signal shouldn't be propagated down to the test program. Which shell do you use? – tue Sep 10 '13 at 07:45
  • 1
    That test will fail BTW; the result of `for` is an empty string and not `0`… – Donal Fellows Sep 10 '13 at 09:36

1 Answers1

1

How did you invoke nohup? I ssh into a Ubuntu server 13.04 system, created the tests, and issued the following commands:

nohup all_test.sh &
logout

Later on, when I came back, I was able to verify that the test ran all the way through (and failed, but that's another story).

Hai Vu
  • 37,849
  • 11
  • 66
  • 93