Skip to content

Commit

Permalink
Sort output for test case to avoid race condition
Browse files Browse the repository at this point in the history
As the test uses fork() the processes can write out the lines in different
orders

Resolves: #3106
  • Loading branch information
ffesti committed Jul 5, 2024
1 parent 775acf1 commit 515d252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/rpmmacro.at
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ nil No such file or directory 2.0
[])

RPMTEST_CHECK([
runroot_other rpmlua -e 'pid = posix.fork(); if pid == 0 then a,b,c=rpm.redirect2null(-1); print(string.format("%s\t%s\t%s", a,b,c)); io.flush() else posix.wait(pid) end'
runroot_other rpmlua -e 'pid = posix.fork(); if pid == 0 then a,b,c=rpm.redirect2null(-1); print(string.format("%s\t%s\t%s", a,b,c)); io.flush() else posix.wait(pid) end' 2> >(sort >&2)
],
[0],
[nil Bad file descriptor 9.0
Expand Down

0 comments on commit 515d252

Please sign in to comment.