From: Nathaniel I. <nd...@bu...> - 2002-04-04 18:40:06
|
On Thu, Apr 04, 2002 at 12:15:16PM +0200, RGi...@a1... wrote: > Interesting, I also encountered that error during my test runs, but it > was only temporary, when I reran the test, it worked. If you can > reproduce it consistently, please uncomment the '$Expect::Exp_Internal > = 1' line in test.pl and rerun the test. It will probably vanish then, > just as Murphy predicts. I could reproduce it consistently, so I uncommented that line, and it failed again -- unfortunately I didn't save that output, and when I reran the test with the line uncommented, it completed the test suite. When it was done, however, the only test it had failed was 15, which was the failure in my original message. Here's the output: Continuing expect, restarting timeout... spawn id(4): Does `\r\n' match: pattern #1: -re `Begin'? No. pattern #2: -re `End'? No. pattern #3: -eof `'? No. Waiting for new data (1 seconds)... TIMEOUT Calling timeout function ARRAY(0x41c294)... Waiting for new data (1 seconds)... TIMEOUT Calling timeout function ARRAY(0x41c294)... Waiting for new data (1 seconds)... TIMEOUT Calling timeout function ARRAY(0x41c294)... Waiting for new data (1 seconds)... TIMEOUT Calling timeout function ARRAY(0x41c294)... Waiting for new data (1 seconds)... EOF not ok 15 # Test failed at test.pl line 83. Returning from expect with TIMEOUT or EOF > This leads me to the conclusion that the close-on-exit is broken on > Darwin. > > Workaround: add a 'sleep 1' to the spawn command, > i.e. spawn("someprog; sleep 1"). Let me make sure I understand the syntax you're proposing -- tack on "; sleep 1" to spawn's first argument? To use an example from Crypt:GPG, this my $expect = Expect->spawn ("$self->{GPGBIN}", @opts, '-o-', '--sign', $armor, $detach, '--default-key', $self->{SECRETKEY}, $tmpnam); becomes this: my $expect = Expect->spawn ("$self->{GPGBIN}; sleep 1", @opts, '-o-', '--sign', $armor, $detach, '--default-key', $self->{SECRETKEY}, $tmpnam); There are ten calls to spawn in Crypt::GPG, and I modified them all as shown. It still hangs in test 11, apparently with the same symptoms: http://bumppo.net/expect/debug-trace-2.txt Thanks for all your effort. -nat |