Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Allow slightly too small poll duration in /socket/timed_wait test
Browse files Browse the repository at this point in the history
Sometimes the poll duration in the /socket/timed_wait test is slightly lower
than the requested 100000, causing failures like

ERROR:/build/buildd/glib2.0-2.33.2/./gio/tests/socket.c:619:test_timed_wait:
  assertion failed (poll_duration > = 100000): (99240 >= 100000)
FAIL

Adjust the test to also allow some jitter in the "too small" direction, similar
to the already existing span for "slightly too large".

https://bugzilla.gnome.org/show_bug.cgi?id=678881
  • Loading branch information
Martin Pitt authored and Matthias Clasen committed Jul 14, 2012
1 parent 1da1129 commit 2e76d87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gio/tests/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ test_timed_wait (void)
g_clear_error (&error);
poll_duration = g_get_monotonic_time () - start_time;

g_assert_cmpint (poll_duration, >=, 100000);
g_assert_cmpint (poll_duration, >=, 98000);
g_assert_cmpint (poll_duration, <, 110000);

g_socket_close (client, &error);
Expand Down

0 comments on commit 2e76d87

Please sign in to comment.