[ovs-git] [openvswitch/ovs] 5e65e0: tests: Avoid Windows unit tests from hanging.

GitHub noreply at github.com
Wed Apr 22 20:14:07 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 5e65e080ad4d57eb3fcb7b53980cf6a4d1e8ae19
      https://github.com/openvswitch/ovs/commit/5e65e080ad4d57eb3fcb7b53980cf6a4d1e8ae19
  Author: Gurucharan Shetty <gshetty at nicira.com>
  Date:   2015-04-22 (Wed, 22 Apr 2015)

  Changed paths:
    M tests/ofproto-macros.at
    M tests/ovs-macros.at

  Log Message:
  -----------
  tests: Avoid Windows unit tests from hanging.

It has been observed that sometimes Windows unit tests hang.
This happens when a daemon is started but does not get terminated
when the test ends.

In one particular case, OVS_VSWITCHD_STOP is called which inturn
calls 'ovs-appctl exit'. This causes ovs-vswitchd's atexit handler
to cleanup the pidfiles. After this, the pthread destructurs get
called and a deadlock happens in there. This results in the
daemons not getting force killed resulting in the tests hanging
because the cleanup file tries to run the command
"kill `cat ovs-vswitchd.pid`" and ovs-vswitchd.pid no longer exists.

With this commit, we write the pid value of the daemons in the
cleanup file (instead of asking it to 'cat' the value later from
the pidfile). This way, even if the pidfiles get deleted, we can
still kill the daemons.

This commit also changes the way daemons are force killed in
Windows. It was observed that 'taskkill //F ' failed to kill
a deadlocked daemon running its pthread destructor. But
tskill succeeds.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
(ON_EXIT_UNQUOTED macro provided by Ben.)
Co-authored-by: Ben Pfaff <blp at nicira.com>
Signed-off-by: Ben Pfaff <blp at nicira.com>




More information about the git mailing list