]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commitdiff
perf(net): reduce ping test sleep times for faster test runs
authorTulio A M Mendes <[email protected]>
Thu, 16 Apr 2026 05:42:40 +0000 (02:42 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 16 Apr 2026 05:42:40 +0000 (02:42 -0300)
QEMU virtual NIC doesn't need 2s to stabilize. Reduced initial
wait from 2s to 500ms and inter-ping delay from 1s to 250ms.

src/net/net_ping.c

index dc0ccc6e70a83a61ecd4c5e216c8193897072317..33c2434e3ca8c4f8d3de389a2d55fd4310bfa63c 100644 (file)
@@ -145,7 +145,7 @@ void net_ping_test(void) {
     }
 
     /* Wait for the E1000 link to stabilize in QEMU */
-    process_sleep(2 * TIMER_HZ); /* ~2 seconds */
+    process_sleep(TIMER_HZ / 2); /* ~500ms — plenty for QEMU virtual NIC */
 
     ip_addr_t target;
     ip_addr_set_zero_ip4(&target);
@@ -190,7 +190,7 @@ void net_ping_test(void) {
         }
 
         if (i + 1 < PING_COUNT)
-            process_sleep(TIMER_HZ); /* ~1 second between pings */
+            process_sleep(TIMER_HZ / 4); /* ~250ms between pings */
     }
 
     /* Cleanup in tcpip thread */