RFR: 7904101: intermittent failure in StreamsTest.agentvm.ok [v2]

Vladimir Petko vpetko at openjdk.org
Fri Oct 24 01:36:35 UTC 2025


On Wed, 22 Oct 2025 05:16:57 GMT, Vladimir Petko <vpetko at openjdk.org> wrote:

>> FileDescriptor test intermittently fails because the agent's process output capture lacks synchronisation. 
>> 
>> This PR fixes the issue:
>> - Agent VM prints the "process output separator" to stderr and stdout before and after action
>> - The main vm uses the marker to stop reading the stream for the current test result section (or a general agent log)
>> - The main vm restarts reading the log after updating the test section (or clearing it) until the next marker or the process is shut down.
>> 
>> Alternative:
>>  -Disable the test and make no assumptions about contents of the agent vm process output.
>> 
>> Testing: tier1 and tier2 tests on mainline jdk (Ubuntu Linux) in agentvm mode.
>> 
>> 
>> make test TEST=":tier1 :tier2" JTREG="TEST_MODE=agentvm"
>> 
>> ....
>> 
>> ==============================
>> Test summary
>> ==============================
>>    TEST                                              TOTAL  PASS  FAIL ERROR  SKIP   
>>    jtreg:test/hotspot/jtreg:tier1                     3124  2837     0     0   287   
>>    jtreg:test/jdk:tier1                               2519  2480     0     0    39   
>>    jtreg:test/langtools:tier1                         4670  4660     0     0    10   
>>    jtreg:test/jaxp:tier1                                 0     0     0     0     0   
>>    jtreg:test/lib-test:tier1                            38    38     0     0     0   
>>    jtreg:test/hotspot/jtreg:tier2                      960   913     0     0    47   
>>>> jtreg:test/jdk:tier2                               4455  4220     1     0   234 <<
>>    jtreg:test/langtools:tier2                           14    12     0     0     2   
>>    jtreg:test/jaxp:tier2                               517   516     0     0     1   
>>    jtreg:test/docs:tier2                                 4     0     0     0     4   
>> ==============================
>> TEST FAILURE
>> 
>> 
>> Unrelated failure: test/jdk/java/nio/channels/DatagramChannel/SendReceiveMaxSize.java
>> 
>> 
>> 
>> 
>> ---------System.out:(98/7409)----------
>> Seed from RandomFactory = 7590698091695474155L
>> [15:02:42.244] config SendReceiveMaxSize.setUp(): success [0ms]
>> [15:02:42.272] test SendReceiveMaxSize.testGetOption(SendReceiveMaxSize$$Lambda/0x00000000450736f8 at 8d234b9, 65507, /10.201.67.1): success [7ms]
>> [15:02:42.273] test SendReceiveMaxSize.testGetOption(SendReceiveMaxSize$$Lambda/0x0000000045073920 at 449629ff, 65507, /10.201.67.1): success [0ms]
>> [15:02:42.273] test SendReceiveMaxSize.testGetOption(SendReceiveMaxSize$$Lamb...
>
> Vladimir Petko has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains two new commits since the last revision:
> 
>  - fix: always call stopLogging()
>  - feat: synchronize agent's stdout/stderr logging
>    
>    How it works:
>     - The agent vm emits separator text before and after the text.
>     - The main vm send the action and waits for the separator text line from
>       the agent vm.
>     - After the result have been read by the main vm it expects another separator
>       text line. After consuming the line it redirects output to the agent log.
>    
>    Edge cases:
>     - Timeouts and Agent VM crashes:
>       - The main vm's stdout and stderr tasks will exit due to the
>         closed stream. The main vm is supposed to dispose the failed agent.

Still getting intermittent failure in StreamsTest. moving to draft.

-------------

PR Comment: https://git.openjdk.org/jtreg/pull/295#issuecomment-3440292558


More information about the jtreg-dev mailing list