Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8321163

[test] OutputAnalyzer.getExitValue() unnecessarily logs even when process has already completed

XMLWordPrintable

    • b27

        The JDK test library has a jdk.test.lib.process.OutputAnalyzer class which is used to capture output and exit code of any processes launched from within the tests.

        This OutputAnalyzer has a getExitValue() method. In its current form, when this method is called, it always logs something like:

        [2023-11-24T11:47:54.557561Z] Waiting for completion for process 24909
        [2023-11-24T11:47:54.557873Z] Waiting for completion finished for process 24909
        [2023-11-24T11:47:54.612609Z] Waiting for completion for process 24909
        [2023-11-24T11:47:54.612682Z] Waiting for completion finished for process 24909
        [2023-11-24T11:47:54.614500Z] Waiting for completion for process 24909
        [2023-11-24T11:47:54.614542Z] Waiting for completion finished for process 24909
        [2023-11-24T11:47:54.640945Z] Waiting for completion for process 24909
        [2023-11-24T11:47:54.641115Z] Waiting for completion finished for process 24909

        Notice that even after the process had completed and the exit value already known, there were additional logs which said "Waiting for completion of process".

        There shouldn't have been additional "Waiting for completion for process" logging after the first:

        Waiting for completion finished for process 24909

              jpai Jaikiran Pai
              jpai Jaikiran Pai
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: