[all-commits] [llvm/llvm-project] 357a17: [lit] Send back whole lit.Test object from worker ...

Julian Lettner via All-commits all-commits at lists.llvm.org
Mon Mar 30 22:00:03 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 357a17e298ccd076a9274c9746afd3a9c0a8218e
      https://github.com/llvm/llvm-project/commit/357a17e298ccd076a9274c9746afd3a9c0a8218e
  Author: Julian Lettner <julian.lettner at gmail.com>
  Date:   2020-03-30 (Mon, 30 Mar 2020)

  Changed paths:
    M llvm/utils/lit/lit/Test.py
    M llvm/utils/lit/lit/run.py
    M llvm/utils/lit/lit/worker.py

  Log Message:
  -----------
  [lit] Send back whole lit.Test object from worker process

In previous commits [1,2] I changed worker.py to only send back the test
result from the worker process instead of the whole test object.  This
was a mistake.  lit.Test contains fields (e.g., xfials, requires,
unsupported) that are only populated when we actually execute the test,
but are queried when we report the results in the parent process.  This
commit essentially reverts the following changes:

[1] a3d2f9b53ac006cb972b61b0dbfcb5babe4356bf
[2] 17bb660fb83e869652ac87b145b0e26b708aab60


  Commit: f3c329986cf4349eb45a3e551f936d2b01a03ed5
      https://github.com/llvm/llvm-project/commit/f3c329986cf4349eb45a3e551f936d2b01a03ed5
  Author: Julian Lettner <julian.lettner at gmail.com>
  Date:   2020-03-30 (Mon, 30 Mar 2020)

  Changed paths:
    M llvm/utils/lit/lit/main.py
    M llvm/utils/lit/lit/run.py

  Log Message:
  -----------
  [lit] Remove single process mode

Remove the "serial run" abstraction which bypasses Python's
`multiprocessing.Pool` and instead directly runs tests without spawning
worker processes.  This abstraction has not offered the benefits I hoped
it would and therefore does not carry its weight.


  Commit: 1e8900cc828bd62fdcc314283c991080bae4520c
      https://github.com/llvm/llvm-project/commit/1e8900cc828bd62fdcc314283c991080bae4520c
  Author: Julian Lettner <julian.lettner at apple.com>
  Date:   2020-03-30 (Mon, 30 Mar 2020)

  Changed paths:
    M llvm/utils/lit/lit/formats/shtest.py
    M llvm/utils/lit/tests/Inputs/shtest-inject/lit.cfg
    M llvm/utils/lit/tests/shtest-inject.py

  Log Message:
  -----------
  [lit] Fix test that relied on "single process" mode

The shtest-inject test relied on being executed in "single process" mode
and started to fail with a `PicklingError` after it was removed:
```
  Can't pickle <class 'lit.TestingConfig.CustomFormat'>: attribute
  lookup lit.TestingConfig.CustomFormat failed
```

This happened because the test config has to be serialized to the worker
process, but apparently the `CustomFormat` class defined inline is not
serializable.

This change allows passing the tested functionality (preamble_commands)
directly to `lit.formats.ShTest` so we can use it directly in the test.


Compare: https://github.com/llvm/llvm-project/compare/221fa96cd43c...1e8900cc828b


More information about the All-commits mailing list