While running tests niri opens a lot of file descriptors, so it might make sense to set "ulimit -n" to something like 4096 to prevent niri from panicking when compiling.
With "ulimit -n" set to 1024 I had it failed and with 2048 limit it was just fine, so 4096 seems like a reasonable number.