Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Monday April 13, 2009
04:54 PM

backticks make my Windows testing service hang on ack

[ #38804 ]

I've run into an interesting situation in testing CPAN modules on Windows using TeamCity. Testing from the command line, either cygwin or command, works fine, but when the automated tester has a go, it fails. I traced this back to modules that use system() or backticks. The ack distribution has been the one to demonstrate the problem first. I wonder if anyone else has seen a similar problem.

I've been working on a custom internal CPAN for a big company, and their CPAN is actually in subversion. When the subversion repo changes, lots of tests kick off, including tests for individual modules as well as integration tests. These tests run on both unix and Windows using the TeamCity build agents. Some of the Windows tests just hang forever, although they run fine on my workstation.

It appears that the Windows build agents are run as a Windows service, so it's not connected to something that can handle system calls. I don't understand the Windows set-up and architecture enough to say more than that. Once the build agent hits a line of code that wants to shell out somehow, it hangs forever. It only does this in the build agent.

I was working with ack, which has a t/Util.pm for things that most of the tests use. There is a run_ack_with_stderr() subroutine which uses backticks, and that's where the code hangs. Once it runs t/ack-1.t, everything stops.

Paul's IPC::System::Simple::capture() works as a backticks replacement and has already solved many problems we've had with Windows. However, my first try in replacing backticks made all sorts of other tests fail even though it could run the commands now. Nothing hung, but there was something I wasn't capturing correctly or putting in the right place, I figure. I eventually had to cut bait since I'm not getting paid to work on third-party modules.

I'm curious how this works for the Windows CPAN testers. Are you just running the testing script from a command or terminal window? Do you ignore distros that just hang? I didn't see any sort of ack failure that showed the same symptoms.

And, is there some sort of medal or award that Paul can get for IPC::System::Simple? I wasn't keen on depending on it at first, but now that I've experienced a bit of grief trying to make Windows be unix, I really appreciate IPC::System::Simple taking care of all of that.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • If the tests are failing because IPC::System::Simple is somehow replacing backticks in a fundamentally incompatible way (which is not documented), then a failing test case is better than any medal.

    Otherwise, kind words in a blog post are all the thanks I need. ;)

  • Did you try Capture::Tiny?

  • For the hanging agent/service, you might try: Control Panel -> AdministrativeTools -> Services, choose the offending service, right click (Properties) and check the "Allow service to interact with the desktop" checkbox (this checkbox will probably be in the LogOn tab). No guarantee it will change anything, but it is definitely worth a try, based on the symptoms you describe. Your hangs may be because the Service is not allowed to interact with the desktop and so is not allowed to create a (desktop) co
    --
    /-\
    • I'll have to investigate that a bit more. Not interacting with the Desktop might be a feature. Thanks,