• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

spulec / moto / 7205
95%

Build:
DEFAULT BRANCH: master
Ran 18 Nov 2020 12:19PM UTC
Jobs 8
Files 421
Run time 87min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
7205

push

travis-ci

web-flow
Fix Race Condition in batch:SubmitJob (#3480)

* Extract Duplicate Code into Helper Method

DRY up the tests and replace the arbitrary `sleep()` calls with a more
explicit check before progressing.

* Improve Testing of batch:TerminateJob

The test now confirms that the job was terminated by sandwiching a `sleep`
command between two `echo` commands.  In addition to the original checks
of the terminated job status/reason, the test now asserts that only the
first echo command succeeded, confirming that the job was indeed terminated
while in progress.

* Fix Race Condition in batch:SubmitJob

The `test_submit_job` in `test_batch.py` kicks off a job, calls `describe_jobs`
in a loop until the job status returned is SUCCEEDED, and then asserts against
the logged events.

The backend code that runs the submitted job does so in a separate thread. If
the job was successful, the job status was being set to SUCCEEDED *before* the
event logs had been written to the logging backend.

As a result, it was possible for the primary thread running the test to detect
that the job was successful immediately after the secondary thread had updated
the job status but before the secondary thread had written the logs to the
logging backend.  Under the right conditions, this could cause the subsequent
logging assertions in the primary thread to fail.

Additionally, the code that collected the logs from the container was using
a "dodgy hack" of time.sleep() and a modulo-based conditional that was
ultimately non-deterministic and could result in log messages being dropped
or duplicated in certain scenarios.

In order to address these issues, this commit does the following:

* Carefully re-orders any code that sets a job status or timestamp
  to avoid any obvious race conditions.
* Removes the "dodgy hack" in favor of a much more straightforward
  (and less error-prone) method of collecting logs from the container.
* Removes arbitrary and u... (continued)

5 of 5 new or added lines in 1 file covered. (100.0%)

42385 of 44983 relevant lines covered (94.22%)

5.96 hits per line

Jobs
ID Job ID Ran Files Coverage
1 7205.1 (TEST_SERVER_MODE=false) 18 Nov 2020 12:19PM UTC 0
94.01
Travis Job 7205.1
2 7205.2 (TEST_SERVER_MODE=true) 18 Nov 2020 12:34PM UTC 0
53.86
Travis Job 7205.2
3 7205.3 (TEST_SERVER_MODE=false) 18 Nov 2020 12:34PM UTC 0
93.98
Travis Job 7205.3
4 7205.4 (TEST_SERVER_MODE=true) 18 Nov 2020 01:04PM UTC 0
55.51
Travis Job 7205.4
5 7205.5 (TEST_SERVER_MODE=false) 18 Nov 2020 12:59PM UTC 0
93.97
Travis Job 7205.5
6 7205.6 (TEST_SERVER_MODE=true) 18 Nov 2020 01:25PM UTC 0
55.5
Travis Job 7205.6
7 7205.7 (TEST_SERVER_MODE=false) 18 Nov 2020 01:11PM UTC 0
94.09
Travis Job 7205.7
8 7205.8 (TEST_SERVER_MODE=true) 18 Nov 2020 01:46PM UTC 0
56.36
Travis Job 7205.8
Source Files on build 7205
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #7205
  • f7467164 on github
  • Prev Build on master (#7203)
  • Next Build on master (#7210)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc