[internal] Fix parallel promotion for herd tests - #1938
Conversation
d8fbbd5 to
d664954
Compare
|
Adding @HadrienRenaud to review ASL+herd tests - @psafont said he will provide details on how to run |
|
The fix can be verified by running |
|
Hi @psafont, this looks very nice to me, but I'd like to understand a little bit more before approving. Could you please share a before/after of a command that you changed? Thanks |
Of course, let's run the command for promoting on a branch without the fix: With Then we modify the The arguments it got called with it is: We can see that the To fix this, we change the interface that After the fix the arguments are: The new code, however uses a different output format to show the semantic meaning that it gives to the argument: Similarly, when test is invoked we can see these arguments with the previous code: and with the new code: |
d664954 to
76defc7
Compare
76defc7 to
8da185a
Compare
HadrienRenaud
left a comment
There was a problem hiding this comment.
Thanks a lot for the explanation, this looks very good to me.
151800e to
ac4c4d0
Compare
|
I've added unit-tests for Alcotest combines this with equality tests to have quite succint code, for exmaple, to define a pair of lists of characters, like in the code I added: |
ac4c4d0 to
d2a91b0
Compare
| tests | ||
| ); | ||
|
|
||
| "Base.List.split_at", (fun () -> |
There was a problem hiding this comment.
In general I'm very much in favour of improving our testing infrastructure, but I also think different code paths warrant different degrees of testing. split_at's implementation seems straightforward, and being a general operation on lists it's very unlikely to ever change. Therefore I wonder whether it adds value to have a test such as this one checked in and run at every make test.
There was a problem hiding this comment.
I've found that for long-running project, encoding function behaviours in unit tests is worth it. These are generally very cheap to run, in the order of milliseconds, and they end up being read, or excercised because someone wants to change them because there are curious or there are better that don't need that function. This also helps catching silly mistakes.
One such example is when I replaced several chop functions with split_at: xapi-project/xen-api#6733
Maybe I should rename this function to split_when, as the at seems to indicate a position.
There was a problem hiding this comment.
Maybe I should rename this function to
split_when, as theatseems to indicate a position.
I agree. I was thinking split_with but split_when also works.
d2a91b0 to
45de449
Compare
|
I won't approve this yet as I believe @psafont is still working on some parts of this. |
45de449 to
dfb6862
Compare
Previously it printed the list of arguments, now it prints the command name and its arguments as they are used by the promoter. This helps with finding out issues when calling this executable. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@arm.com>
This is useful for transforming a list into two at a point where a property holds for an item. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@arm.com>
Define a function for each to build the argument list. They don't support the same parameters, so they shouldn't be mixed. The code also does localizes argument-building function into testHerd, to make future changes easier. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@arm.com>
When running or promoting litmus tests in parallel, the parallelizer runs a wrapper, which runs herd7, each of the stages has its own parameters. Early 2025 some parameters were added to the wrapper that runs herd7, but these were not added to the promoter, and since then parameters have accumulated. Unfortunately the handling of these parameters was not added to the promoter, causing failures to the promotion when these parameters are present. We therefore have to find a way to allow this parameters to be present for the runner while the promoter can ignore these easily. This commit solves this by using the common practice of separating the arguments for the launcher and the launched programs using "--" with a shared function. No other users of herd_test.exe or herd_promote.exe were found. Further work may include changing the wrapper's handling of its own parameters use Arg, or make the promoter be aware of the arguments. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@arm.com>
dfb6862 to
5689648
Compare
|
I believe that the commit [internal] Recognise the different wrappers for herd (promote and test) Should fix the issue, but I'm still seeing warnings regardings some promotions not having any output. The last two commits change interfaces for cli tools, and might not be worth merging:
For this reasons I'm leaving this as draft for the time being. |
Mapply is a wrapper for executing other cli commands, this means that it should be flexible enough to allow for arbitrary parameters for these commands. The current scheme used encodes the parameters in a comma-separated-list. Because escaping is not implemented, it means that parameters with commas cannot be used at all. There's a standard that can be used that sidesteps, which is separating arguments meant for mapply, and arguments meant for the target command using '--'. These can be nested without causing issues, and don't need any kind of escaping or other complex schemes. This is a breaking change, so we need to understand how the tool is used and warn all users. Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@arm.com>
5689648 to
f908194
Compare
When running or promoting litmus tests in parallel, the parallelizer
runs a wrapper, which runs herd7, each of the stages has its own
parameters. Early 2025 some parameters were added to the wrapper that
runs herd7, but these were not added to the promoter, and since then
parameters have accumulated. Unfortunately the handling of these
parameters was not added to the promoter, causing failures to the
promotion when these parameters are present. We therefore have to find a
way to allow this parameters to be present for the runner while the
promoter can ignore these easily.
This commit solves this by using the common practice of separating the
arguments for the launcher and the launched programs using "--" with a
shared function.
Further work may include changing the wrapper's handling of its own
parameters use Arg, or make the promoter be aware of the arguments.
Opening as a draft to allow @Roman-Manevich to test the promotion of ASL tests