Copilot commented on code in PR #910:
URL: 
https://github.com/apache/skywalking-banyandb/pull/910#discussion_r2638409703


##########
fodc/internal/integration/capacity_heap_test.go:
##########
@@ -410,7 +411,10 @@ var _ = Describe("Test Case 4: Capacity Size and Heap 
Inuse Size", func() {
 
                // Step 2: Measure baseline heap inuse size (before any data)
                // Force GC to reduce temporary allocation noise
-               runtime.GC()
+               Eventually(func() bool {
+                       runtime.GC()
+                       return true
+               }, 5*time.Second).Should(BeTrue())

Review Comment:
   The Eventually block always returns true immediately on the first iteration, 
so it doesn't actually wait for garbage collection to complete or stabilize. 
This makes the 5-second timeout ineffective. If the intent is to wait for GC to 
stabilize memory, consider calling runtime.GC() multiple times with a small 
delay between calls, or simply call it once without wrapping it in Eventually. 
The Eventually assertion pattern is typically used for polling until a 
condition becomes true, but here the condition is always true.
   ```suggestion
                runtime.GC()
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to