It's easier if you sort the list of files first before passing it to grep:
In zsh, you can do:
grep -le hello -- **/test<->(.)
Which looks for hello in the contents of files whose name is test followed by one or more decimal digits (<-> being a form of the <x-y> pattern to match ranges of numbers), in or below the current working directory, skipping hidden directories.
Glob expansions by default are sorted by name.
To sort by modification time, use (.om) instead of (.). or (.oL) by size. See info zsh qualifiers for the list of glob qualifiers and the list of criteria the o qualifier can sort by.
Replace o with O to reverse the order (On to sort in reverse by name).
Use (.n) for the sort by name to be numerical (test10 to come after test9, not in between test1 and test2).
If you run into a Too many arguments error (caused by a limitation of the execve() system call of most system):
autoload -Uz zargs # best in ~/.zshrc
zargs -- **/test<->(.) -- grep -le hello --
With GNU tools and any shell (except (t)csh where you'd need to put the command on one line):
To sort by name:
LC_ALL=C find . -regextype posix-extended -name '.?*' -prune -o \
-regex '.*/test[0-9]+' -type f -print0 |
sort -z |
xargs -r0 grep -le hello --
(add the -V option to sort for a numerical sort)
To sort by modification time:
LC_ALL=C find . -regextype posix-extended -name '.?*' -prune -o \
-regex '.*/test[0-9]+' -type f -printf '%T@\t%p\0' |
sort -zrn |
cut -zf2- |
xargs -r0 grep -le hello --
Add / remove -r to sort to reverse the order.