tests: Fix threading race in "ofproto-dpif megaflow - learning" test.
authorBen Pfaff <blp@nicira.com>
Tue, 13 Aug 2013 19:37:50 +0000 (12:37 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 13 Aug 2013 19:37:50 +0000 (12:37 -0700)
commit956f2bf03d5f377ea64dd58e232bc6b44f5959b1
tree7f88683a712f766723c658281279ef5896e41d94
parentb0ed42c8be975474c158b553471b706f979ad8cd
tests: Fix threading race in "ofproto-dpif megaflow - learning" test.

Threaded ofproto-dpif uses a queue to pass packets from the forwarding
threads to the main thread for (mega)flow setup and for learning.  When
learning occurs, causing revalidations, this races against flow setup, so
that sometimes a datapath (mega)flow does get set up for a packet that
causes learning and sometimes it doesn't.  This caused this test to
sometimes fail because one megaflow or the other that was expected to be
set up was not.

This commit fixes the problem by sending a second packet in each flow.
These additional packets don't cause any additional changes to the flow
table but they do cause flows to be set up, fixing the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
tests/ofproto-dpif.at