[ovs-git] [openvswitch/ovs] 2c920d: tests: Run OVS_WAIT_WHILE, OVS_WAIT_UNTIL in main ...

GitHub noreply at github.com
Thu Nov 26 21:28:45 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 2c920d9d84cfdaa486e3da63cd4b77413221fb64
      https://github.com/openvswitch/ovs/commit/2c920d9d84cfdaa486e3da63cd4b77413221fb64
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2015-11-26 (Thu, 26 Nov 2015)

  Changed paths:
    M tests/ovs-macros.at

  Log Message:
  -----------
  tests: Run OVS_WAIT_WHILE, OVS_WAIT_UNTIL in main shell environment.

AT_CHECK runs its commands in a subshell.  That means that (among other
effects), any variable assignments within its commands will disappear after
the commands' completion.  That doesn't matter for any of the existing
users, which don't do the sorts of things that affect an outer shell
environment anyhow, but an upcoming user wants to make a shell assignment
that persists.  This commit makes that possible, by using AT_CHECK
(actually AT_FAIL_IF but it's moot) only upon failure instead of bracketing
the entire test.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Reviewed-by: Simon Horman <simon.horman at netronome.com>
Acked-by: Flavio Leitner <fbl at sysclose.org>


  Commit: 4c619f4d8bb2d773e34cc9a608b125b2601c1271
      https://github.com/openvswitch/ovs/commit/4c619f4d8bb2d773e34cc9a608b125b2601c1271
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2015-11-26 (Thu, 26 Nov 2015)

  Changed paths:
    M tests/ovs-macros.at

  Log Message:
  -----------
  tests: Make OVS_WAIT_WHILE, OVS_WAIT_UNTIL run even faster in some cases.

Sometimes OVS_WAIT_WHILE and OVS_WAIT_UNTIL are used for conditions that
tend to be true immediately but sometimes take a moment or two.  This
change makes such cases 0.1 seconds faster (which could add up over
hundreds of tests).

Signed-off-by: Ben Pfaff <blp at ovn.org>
Reviewed-by: Simon Horman <simon.horman at netronome.com>
Acked-by: Flavio Leitner <fbl at sysclose.org>


  Commit: fb28ef2d6ef847737176bb601ca99879dfc51f9e
      https://github.com/openvswitch/ovs/commit/fb28ef2d6ef847737176bb601ca99879dfc51f9e
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2015-11-26 (Thu, 26 Nov 2015)

  Changed paths:
    M tests/ofproto-dpif.at
    M tests/ofproto-macros.at
    M tests/ovs-vsctl.at
    M tests/ovsdb-idl.at
    M tests/ovsdb-server.at

  Log Message:
  -----------
  tests: Make parse_listening_port entirely reliable.

In test runs, I've occasionally seen mysterious failures in which
parse_listening_port failed to find the listening port even though an
examination of the log file showed that it was there.  I spent some time
trying to figure out what was going wrong.  It seemed like everything was
lined up properly to ensure that a command like "ovs-vsctl set-controller
br0 tcp:127.0.0.1:0" would only return to the command prompt after the
new listener was ready and the proper log message was written.  It was
obviously a very small race because I could only reproduce it with a large
test parallelism (e.g. -j10 on my quad-core laptop).

The problem turned out to be asynchronous logging in ovs-vswitchd.  If I
turned that off, by commenting out the call to vlog_enable_async() in
bridge.c, parse_listening_port became reliable.

This commit works around the problem by making parse_listening_port retry
for a while if necessary.  It also transforms the shell function into an
m4 macro (so that it can use OVS_WAIT_UNTIL) and renames it to
all-uppercase to follow the convention for macros.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Reviewed-by: Simon Horman <simon.horman at netronome.com>
Acked-by: Flavio Leitner <fbl at sysclose.org>


Compare: https://github.com/openvswitch/ovs/compare/73e8bc237197...fb28ef2d6ef8


More information about the git mailing list