apache / apache/maven-surefire

[SUREFIRE-2027] Flaky test AsyncSocketTest

Open
#2,729 4 comments 0 reactions 0 assignees View on GitHub
bug priority:critical
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Olivier Lamy](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=olamy)** opened **[SUREFIRE-2027](https://issues.apache.org/jira/browse/SUREFIRE-2027?redirect=false)** and commented

This looks to be a flaky test

> {{Error: Tests run: 193, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 16.435 s <<< FAILURE! - in org.apache.maven.JUnit4SuiteTest }}
> {{Error: org.apache.maven.surefire.api.util.internal.AsyncSocketTest.test Time elapsed: 5.311 s <<< ERROR! }}
> `[694](https://github.com/apache/maven-surefire/runs/5349295808?check_suite_focus=true#step:7:694)java.lang.AssertionError: `
> `[695](https://github.com/apache/maven-surefire/runs/5349295808?check_suite_focus=true#step:7:695)`
> `[696](https://github.com/apache/maven-surefire/runs/5349295808?check_suite_focus=true#step:7:696)Expecting actual: `
> `[697](https://github.com/apache/maven-surefire/runs/5349295808?check_suite_focus=true#step:7:697) 1237L `
> `[698](https://github.com/apache/maven-surefire/runs/5349295808?check_suite_focus=true#step:7:698)to be less than: `
> `[699](https://github.com/apache/maven-surefire/runs/5349295808?check_suite_focus=true#step:7:699) 1000L `
> `[700](https://github.com/apache/maven-surefire/runs/5349295808?check_suite_focus=true#step:7:700) at org.apache.maven.surefire.api.util.internal.AsyncSocketTest.test(AsyncSocketTest.java:185)`

 

The code here https://github.com/apache/maven-surefire/blob/3050d2e32b957bbc98112979c27e977a39933fa6/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/AsyncSocketTest.java#L182  is making some assumptions which really depends on the network of the node where tests are running. Time to transfer data on a node cannot be evaluate with such strict figures it depends how busy is the operating system. 

---
No further details from [SUREFIRE-2027](https://issues.apache.org/jira/browse/SUREFIRE-2027?redirect=false)

Contributor guide

Open the contributing guide

Research direction

Start with surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/AsyncSocketTest.java around line 182 and review the failure at line 185. Run the AsyncSocketTest and inspect how its transfer-time assertion behaves under slower or busier systems. Done means the test no longer relies on an overly strict fixed timing assumption while still checking the socket behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.