<#13421 `java/dependency_inference/import_parser_t...
# github-notifications
q
#13421 `java/dependency_inference/import_parser_test.py` is flaky Issue created by Eric-Arellano on <!date^1635550077^{date_short}|2021-10-29T23:27:57Z>
Copy code
22:53:19.97 [ERROR] Completed: Run Pytest - src/python/pants/backend/java/dependency_inference/import_parser_test.py:tests failed (exit code 1).
270
============================= test session starts ==============================
271
collecting ... collected 2 items
272

273
src/python/pants/backend/java/dependency_inference/import_parser_test.py::test_parse_java_imports FAILED [ 50%]
274
src/python/pants/backend/java/dependency_inference/import_parser_test.py::test_parse_java_imports_subtargets PASSED [100%]
275

276
=================================== FAILURES ===================================
277
___________________________ test_parse_java_imports ____________________________
278

279
rule_runner = RuleRunner(build_root=/tmp/_BUILD_ROOTn86i3c96)
280

281
    @maybe_skip_jdk_test
282
    def test_parse_java_imports(rule_runner: RuleRunner) -> None:
283
        rule_runner.write_files(
284
            {
285
                "BUILD": dedent(
286
                    """\
287
                    java_sources(name = 'lib', compatible_resolves = ['test',],)
288
                    """
289
                ),
290
                "ExampleLib.java": dedent(
291
                    """\
292
                    import org.pantsbuild.example.foo.Foo;
293
    
294
                    public class ExampleLib {}
295
                    """
296
                ),
297
            }
298
        )
299
    
300
        target = rule_runner.request(
301
            Targets, [UnparsedAddressInputs(["//:lib"], owning_address=None)]
302
        ).expect_single()
303
>       assert (
304
            rule_runner.request(
305
                ParsedJavaImports,
306
                [
307
                    ParseJavaImportsRequest(
308
                        sources=target[JavaSourceField],
309
                    )
310
                ],
311
            )
312
            == ParsedJavaImports(["org.pantsbuild.example.foo.Foo"])
313
        )
314

315
src/python/pants/backend/java/dependency_inference/import_parser_test.py:88: 
316
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
317
src/python/pants/testutil/rule_runner.py:303: in request
318
    self.scheduler.product_request(output_type, [Params(*inputs)])
319
src/python/pants/engine/internals/scheduler.py:572: in product_request
320
    self._raise_on_error([t for _, t in throws])
321
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
322

323
self = <pants.engine.internals.scheduler.SchedulerSession object at 0x7f5942535990>
324
throws = [Throw(exc=ProcessExecutionFailure("Process 'Resolving with coursier: org.javassist:javassist:3.28.0-GA' failed with e...e_fallible_result_to_analysis', 'pants.backend.java.dependency_inference.import_parser.parse_java_imports', 'select'])]
325

326
    def _raise_on_error(self, throws: list[Throw]) -> NoReturn:
327
        exception_noun = pluralize(len(throws), "Exception")
328
    
329
        if self._scheduler.include_trace_on_error:
330
            throw = throws[0]
331
            etb = throw.engine_traceback
332
            python_traceback_str = throw.python_traceback or ""
333
            engine_traceback_str = ""
334
            others_msg = f"\n(and {len(throws) - 1} more)" if len(throws) > 1 else ""
335
            if etb:
336
                sep = "\n  in "
337
                engine_traceback_str = "Engine traceback:" + sep + sep.join(reversed(etb)) + "\n"
338
            raise ExecutionError(
339
                f"{exception_noun} encountered:\n\n"
340
                f"{engine_traceback_str}"
341
                f"{python_traceback_str}"
342
                f"{others_msg}",
343
>               wrapped_exceptions=tuple(t.exc for t in throws),
344
            )
345
E           pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:
346
E           
347
E           Engine traceback:
348
E             in select
349
E             in pants.backend.java.dependency_inference.import_parser.parse_java_imports
350
E             in pants.backend.java.dependency_inference.java_parser.resolve_fallible_result_to_analysis
351
E             in pants.backend.java.dependency_inference.java_parser.analyze_java_source_dependencies
352
E             in pants.backend.java.dependency_inference.java_parser_launcher.build_processors
353
E             in pants.jvm.resolve.coursier_fetch.materialize_classpath
354
E             in pants.jvm.resolve.coursier_fetch.coursier_fetch_lockfile
355
E             in pants.jvm.resolve.coursier_fetch.coursier_fetch_one_coord
356
E             in pants.engine.process.fallible_to_exec_result_or_raise
357
E           Traceback (most recent call last):
358
E             File "/tmp/process-executionEZr0Xp/src/python/pants/engine/process.py", line 278, in fallible_to_exec_result_or_raise
359
E               local_cleanup=global_options.options.process_execution_local_cleanup,
360
E           pants.engine.process.ProcessExecutionFailure: Process 'Resolving with coursier: org.javassist:javassist:3.28.0-GA' failed with exit code 126.
361
E           stdout:
362
E           
363
E           stderr:
364
E           + coursier_exe=./cs-x86_64-pc-linux
365
E           + shift
366
E           + json_output_file=coursier_report.json
367
E           + shift
368
E           + ./cs-x86_64-pc-linux fetch --json-output-file=coursier_report.json --intransitive org.javassist:javassist:3.28.0-GA
369
E           coursier_wrapper_script.sh: line 8: ./cs-x86_64-pc-linux: Text file busy
370
E           
371
E           
372
E           
373
E           Use --no-process-execution-local-cleanup to preserve process chroots for inspection.
374

375
src/python/pants/engine/internals/scheduler.py:512: ExecutionError
376
- generated xml file: /tmp/process-executionEZr0Xp/src.python.pants.backend.java.dependency_inference.import_parser_test.py.tests.xml -
377

378

379
=========================== short test summary info ============================
380
FAILED src/python/pants/backend/java/dependency_inference/import_parser_test.py::test_parse_java_imports
381
========================= 1 failed, 1 passed in 29.32s =========================
382
pantsbuild/pants