Skip to content

Commit a329537

Browse files
authored
Merge pull request #1523 from NixOS/gitea
tests: Gitea test nitpicks
2 parents 8481acd + 5f8ae15 commit a329537

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

t/Hydra/Plugin/gitea.t

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,23 @@ if (!defined($pid = fork())) {
5858
ok(sendNotifications(), "Sent notifications");
5959

6060
kill('INT', $pid);
61+
waitpid($pid, 0);
6162
}
6263

6364
# We expect $ctx{jobsdir}/server.py to create the file at $filename, but the time it
6465
# takes to do so is non-deterministic. We need to give it _some_ time to hopefully
6566
# settle -- but not too much that it drastically slows things down.
6667
for my $i (1..10) {
67-
if (! -f $filename) {
68-
diag("$filename does not yet exist");
69-
sleep(1);
70-
}
68+
last if -f $filename;
69+
diag("$filename does not yet exist");
70+
sleep(1);
7171
}
7272

7373
open(my $fh, "<", $filename) or die ("Can't open(): $!\n");
74-
my $i = 0;
75-
my $uri = <$fh>;
74+
my $request_uri = <$fh>;
7675
my $data = <$fh>;
7776

78-
ok(index($uri, "gitea/api/v1/repos/root/foo/statuses") != -1, "Correct URL");
77+
ok(index($request_uri, "gitea/api/v1/repos/root/foo/statuses") != -1, "Correct URL");
7978

8079
my $json = JSON->new;
8180
my $content;

0 commit comments

Comments
 (0)