No, Zig has no way of detecting infinite loops. If you have a real problem with hanging tests, the debugging mechanisms involve debuggers and prints. Run the test and interrupt it after some time, see the stack trace. If it’s multi threaded or depends on timing, adding prints might work better.
There is a reason why the default quota is 1000 backward branches and why users are discouraged from calling @setEvalBranchQuota with std.math.maxInt(u32) or some other arbitrarily huge number. It’s better calculate and use an upper bound based on the specific context of the comptime loop, for example, @setEvalBranchQuota(2 * @typeInfo(T).@"struct".fields.len if you know you will be iterating over a struct’s fields two times over.