[Commits] [wesnoth/wesnoth] 2c4d72: Fix multiplayer tests failing in Travis CI

GitHub noreply at github.com
Sat Sep 3 14:31:31 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 2c4d72f544b447d5a225f349b2078923e2f767cf
      https://github.com/wesnoth/wesnoth/commit/2c4d72f544b447d5a225f349b2078923e2f767cf
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-09-03 (Sat, 03 Sep 2016)

  Changed paths:
    M join.lua
    M src/play_controller.cpp

  Log Message:
  -----------
  Fix multiplayer tests failing in Travis CI

It depends on timing whether or not the guest shows the wait dialog between
scenarios. If the second scenario has already started when the guest tries
to show the dialog, the dialog is skipped: otherwise it's shown and it
changes the plugin context.

The join.lua plugin assumed the change of plugin context to mean that the
test is over and that the plugin should quit the game. As a result, it
ended up quitting in the middle of the test if the second scenario hadn't
started yet.

Commit 6016bdf2 tried to fix the problem by allowing the plugin context to
change once during the test. It resulted in the opposite problem: if the
second scenario *had* started, the plugin context didn't change. When the
test ended and the guest was thrown into the lobby, then the plugin
assumed that it was just the scenario change and kept waiting for the next
scenario that wasn't coming.

This commit finally fixes the problem by explicitly polling the name of the
scenario being played. Now join.lua ignores plugin context changes as long
as the last scenario hasn't started, but starts waiting for the game to end
when the scenario starts.

I verified locally that, with these changes applied, the tests pass both
with an unmodified build and with a build that has an artificial delay to
simulate the timing in Travis.





More information about the Commits mailing list