Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable test timeouts in meson check globally #247024

Open
Atemu opened this issue Aug 3, 2023 · 16 comments
Open

Disable test timeouts in meson check globally #247024

Atemu opened this issue Aug 3, 2023 · 16 comments

Comments

@Atemu
Copy link
Member

Atemu commented Aug 3, 2023

Issue description

So on my mac with employer-imposed antivirus snakeoil, a build of p11-kit just failed because a test timed out after 30s. Running it a few times with hot caches and with no other builds in the background made it finally pass but that really just shouldn't happen.

We have configurable timeouts for the entire build, so I don't think we need any per-test timeouts. If a test needs a few minutes rather than a few seconds one time, so be it. That shouldn't fail an entire build IMHO.

Question to the community: Should we just disable timeouts in meson checks globally?

meson test --timeout-multiplier 0 should do it according to the documentation but I'm a bit at a loss where meson test is even invoked or else I'd have made a PR. Perhaps meson maintainers know how this works (cc @brandonedens @AndersonTorres).

@Artturin
Copy link
Member

Artturin commented Aug 3, 2023

meson test

#213845

AFAIK ninja is currently being used to run the tests.

@Atemu
Copy link
Member Author

Atemu commented Aug 3, 2023

(e.g. setting custom timeouts for tests — my motivation for this change).

It looks like greater minds have already thought of this.

cc @alyssais

@Artturin
Copy link
Member

Artturin commented Aug 3, 2023

There's also manually run meson test

checkPhase = ''
runHook preCheck
meson test --timeout-multiplier 4
runHook postCheck
'';

@Artek52
Copy link

Artek52 commented Oct 6, 2023

I am running in the same problem, trying to build this #247766, failing 10 times for 10 different timeout errors

@alyssais
Copy link
Member

alyssais commented Oct 6, 2023

I think the only thing left to do on my PR was to incorporate @jtojnar's documentation suggestion — I can do that soon. I got a bit fed up of so many rounds of review so I put it down for a while.

@alyssais
Copy link
Member

alyssais commented Oct 9, 2023

#213845 is now in staging.

@theCapypara
Copy link
Member

Sorry for bumping this, but I just had p11-kit's (0.25.3) checks timeout on my Mac VM with the nixos-24.05 branch. Is this properly implemented yet, or is there something that needs to be configured?

@szh
Copy link

szh commented Jul 31, 2024

I'm running into the same issue. Is there currently a workaround?

@Artturin
Copy link
Member

Artturin commented Sep 3, 2024

I'm running into the same issue. Is there currently a workaround?

@szh mesonCheckFlags = [ "--timeout-multiplier" "0" ];

@ofekd
Copy link

ofekd commented Sep 7, 2024

@Artturin is there a way to apply this globally? I'm getting quite a few timeouts in different packages

Edit: to clarify -- without having all meson-dependent packages recompile, I just want to set this for the cache misses.

@Atemu
Copy link
Member Author

Atemu commented Sep 7, 2024

Doing this globally is what this issue is about.

Without rebuilds is not possible as this changes the inputs to the drv.

@ofekd
Copy link

ofekd commented Sep 8, 2024

Thanks -- I mistakenly thought it was about changing the defaults and that the toggle already existed

@cor
Copy link
Contributor

cor commented Sep 17, 2024

Tip for those who struggle with this, it appears that the timeouts happen when you nix build a bigger package/nixosConfiguration because your computer is compiling a lot of things at once. A workaround for this is to build the derivation that triggers the timeout in isolation. For example, if you see

error: builder for '/nix/store/ph1h78hg21av397ksi56jz4cxycklrh7-p11-kit-0.25.0.drv' failed with exit code 2;
       last 10 log lines:
       >
       >
       > Ok:                 56
       > Expected Fail:      0
       > Fail:               0
       > Unexpected Pass:    0
       > Skipped:            0
       > Timeout:            2
       >
       > Full log written to /private/tmp/nix-build-p11-kit-0.25.0.drv-3/source/build/meson-logs/testlog.txt
       For full logs, run 'nix log /nix/store/ph1h78hg21av397ksi56jz4cxycklrh7-p11-kit-0.25.0.drv'.

Then you can fix it by running:

nix-build /nix/store/ph1h78hg21av397ksi56jz4cxycklrh7-p11-kit-0.25.0.drv

(Note the hyphen! nix-build rather than nix build)

Wait for that to complete, and then re-run your original command

@alienman5k
Copy link

I'm running into the same issue. Is there currently a workaround?

@szh mesonCheckFlags = [ "--timeout-multiplier" "0" ];

Where is this setting supposed to be set? Should I override an existing package that is failing (p11-kit) and add this attribute?

@Artturin
Copy link
Member

#356589

@alienman5k
Copy link

alienman5k commented Nov 17, 2024

Just in case anyone still facing this issue, to me instructions were not clear, but I assumed that the settings described above had to be set in an overlay, so below is my snippet:

final: prev: {
 p11-kit = prev.p11-kit.overrideAttrs (oldAttrs: {
   mesonCheckFlags = oldAttrs.mesonCheckFlags or [] ++ [ 
     "--timeout-multiplier" "0" 
   ];
 });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants