View Issue Details

IDProjectCategoryView StatusLast Update
0002286GNUnetstatistics servicepublic2012-06-02 19:15
ReporterLRN Assigned ToLRN  
PrioritylowSeverityminorReproducibilityrandom
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.9.3Fixed in Version0.9.3 
Summary0002286: test_statistics_api_watch_zero_value randomly fails
Descriptionr21161+5
Additional InformationThis is a successful run:
апр 26 10:38:06-00000000000764935701 util-16272 INFO Trying to connect to `[::1]:22353' (0x1dcfde0)
апр 26 10:38:06-00000000000764935701 util-16272 INFO Trying to connect to `127.0.0.1:22353' (0x1dcfde0)
апр 26 10:38:06-00000000000764935702 util-16272 INFO Trying to connect to `[::1]:22353' (0x1dd0728)
апр 26 10:38:06-00000000000764935702 util-16272 INFO Trying to connect to `127.0.0.1:22353' (0x1dd0728)
апр 26 10:38:06-00000000000764935713 util-16452 INFO Disabling UNIX domain socket support for service `statistics', failed to create UNIX domain socket: Address family not supported by protocol family
апр 26 10:38:06-00000000000764935713 util-16452 ERROR `inet_pton' failed at service.c:343 with error: Address family not supported by protocol family
апр 26 10:38:06-00000000000764935713 util-16452 WARNING Could not parse IPv6 network specification `::1;' for `statistics:ACCEPT_FROM6'
апр 26 10:38:06-00000000000764935713 util-16452 INFO Service `statistics' runs at [::]:22353
апр 26 10:38:06-00000000000764935713 util-16452 INFO Service `statistics' runs at 0.0.0.0:22353
апр 26 10:38:06-00000000000764936201 util-16452 INFO Accepting connection from `127.0.0.1:49484': 0x1ee0440
апр 26 10:38:06-00000000000764936201 util-16452 INFO Accepting connection from `127.0.0.1:49486': 0x1ee37f8
апр 26 10:38:06-00000000000764936202 test-statistics-api-16272 INFO Watch 2 received value `dummy-2' `test-2' 42
апр 26 10:38:06-00000000000764936202 test-statistics-api-16272 INFO Watch 1 received value `dummy' `test-1' 0
апр 26 10:38:06-00000000000764936203 test-statistics-api-16272 INFO Watch 1 received value `dummy' `test-1' 42
апр 26 10:38:06-00000000000764936203 test-statistics-api-16272 INFO Watch 1 received value `dummy' `test-1' 0

This is a failed run:
апр 26 10:36:49-00000000000764859245 util-17024 INFO Trying to connect to `[::1]:22353' (0x610060)
апр 26 10:36:49-00000000000764859245 util-17024 INFO Trying to connect to `127.0.0.1:22353' (0x610060)
апр 26 10:36:49-00000000000764859245 util-17024 INFO Trying to connect to `[::1]:22353' (0x610948)
апр 26 10:36:49-00000000000764859245 util-17024 INFO Trying to connect to `127.0.0.1:22353' (0x610948)
апр 26 10:36:49-00000000000764859260 util-16368 INFO Disabling UNIX domain socket support for service `statistics', failed to create UNIX domain socket: Address family not supported by protocol family
апр 26 10:36:49-00000000000764859260 util-16368 ERROR `inet_pton' failed at service.c:343 with error: Address family not supported by protocol family
апр 26 10:36:49-00000000000764859260 util-16368 WARNING Could not parse IPv6 network specification `::1;' for `statistics:ACCEPT_FROM6'
апр 26 10:36:49-00000000000764859260 util-16368 INFO Service `statistics' runs at [::]:22353
апр 26 10:36:49-00000000000764859260 util-16368 INFO Service `statistics' runs at 0.0.0.0:22353
апр 26 10:36:50-00000000000764859737 util-16368 INFO Accepting connection from `[::1]:49430': 0x1f24468
апр 26 10:36:50-00000000000764859738 test-statistics-api-17024 INFO Watch 1 received value `dummy' `test-1' 0
апр 26 10:36:50-00000000000764859738 test-statistics-api-17024 INFO Watch 1 received value `dummy' `test-1' 42
апр 26 10:36:50-00000000000764859738 test-statistics-api-17024 INFO Watch 1 received value `dummy' `test-1' 0
апр 26 10:36:50-00000000000764859744 util-16368 INFO Accepting connection from `[::1]:49428': 0x7ffdf0
апр 26 10:36:50-00000000000764859744 util-16368 INFO Accepting connection from `127.0.0.1:49429': 0x1f24118
апр 26 10:36:50-00000000000764859745 test-statistics-api-17024 INFO Watch 2 received value `dummy-2' `test-2' 42
Timeout, failed to receive notifications: 0

That is, this has something to do with connection timing.
TagsNo tags attached.
Attached Files
0001-Also-shutdown-test-on-watch2.patch (1,015 bytes)   
From c47b87b505c6b4f8dd23fafa31381959f242cb95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1=D1?=
 =?UTF-8?q?=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com>
Date: Thu, 26 Apr 2012 13:22:47 +0400
Subject: [PATCH] Also shutdown test on watch2

---
 .../test_statistics_api_watch_zero_value.c         |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c
index bbbefe9..9df09e4 100644
--- a/src/statistics/test_statistics_api_watch_zero_value.c
+++ b/src/statistics/test_statistics_api_watch_zero_value.c
@@ -103,6 +103,11 @@ watch_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
   if ((42 == value) && (1 == ok2))
   {
     ok2 = 0;
+    if (0 == ok)
+    {
+      GNUNET_SCHEDULER_cancel (shutdown_task);
+      GNUNET_SCHEDULER_add_now (&normal_shutdown, NULL);
+    }
   }
   else
   {
-- 
1.7.4

Activities

LRN

2012-04-26 11:27

developer   ~0005743

Uploaded a fix.
AFAIU, the test wrongly assumed that watch1 callback is called at least once after watch2 callback is, but in some rare cases (when second connection is delayed) this is not true, and watch2 callback is the last one to happen.
The fix makes sure that test is shut down normally in that case as well.

(I'm assuming that late call to watch2 is not a bug, and such behaviour does not go against the developers' intentions)

Christian Grothoff

2012-04-26 19:00

manager   ~0005751

Patch applied in SVN 21179.

Issue History

Date Modified Username Field Change
2012-04-26 08:43 LRN New Issue
2012-04-26 11:24 LRN File Added: 0001-Also-shutdown-test-on-watch2.patch
2012-04-26 11:27 LRN Note Added: 0005743
2012-04-26 19:00 Christian Grothoff Note Added: 0005751
2012-04-26 19:00 Christian Grothoff Status new => resolved
2012-04-26 19:00 Christian Grothoff Fixed in Version => 0.9.3
2012-04-26 19:00 Christian Grothoff Resolution open => fixed
2012-04-26 19:00 Christian Grothoff Assigned To => LRN
2012-04-26 19:00 Christian Grothoff Target Version => 0.9.3
2012-06-02 19:15 Christian Grothoff Status resolved => closed