Change the test main function to chdir using an abs path. (#1586)

The old code chdirs to a path relative from the
$TEST_SRCDIR/$TEST_WORKSPACE. This creates a problem when a unittest tries to
fork & exec itself to create a clone of itself. The cwd of the forked subprocess
is already at $TEST_SRCDIR/$TEST_WORKSPACE/go/src/something, and its main()
tries to chdir to go/src/something again and crashes.

A unittest trying to fork & execitself might sound strange, but Mapreduce-style
application does this regularly.
1 file changed