Skip to content

Commit d676f7b

Browse files
committed
Merge branch 'aws_97' into 'master'
Attempt to stabilize the test See merge request eng/toolchain/aws!131
2 parents c8bb91c + 6a95938 commit d676f7b

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

regtests/0079_pipe_stream/pipe_stream.adb

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ with Ada.Text_IO.Text_Streams;
2424

2525
with GNAT.OS_Lib;
2626

27+
with AWS.Default;
2728
with AWS.Client;
29+
with AWS.Config.Set;
2830
with AWS.MIME;
2931
with AWS.Resources.Streams.Pipe;
3032
with AWS.Response;
@@ -41,7 +43,8 @@ procedure Pipe_Stream is
4143

4244
package ASB renames Ada.Synchronous_Barriers;
4345

44-
WS : Server.HTTP;
46+
WS : Server.HTTP;
47+
Conf : AWS.Config.Object;
4548
Barrier : ASB.Synchronous_Barrier (8);
4649

4750
Stdout : constant Text_IO.Text_Streams.Stream_Access :=
@@ -69,7 +72,10 @@ procedure Pipe_Stream is
6972
Strm := new Resources.Streams.Pipe.Stream_Type;
7073

7174
Resources.Streams.Pipe.Open
72-
(Resources.Streams.Pipe.Stream_Type (Strm.all), "./pipe_stream", Args,
75+
(Pipe => Resources.Streams.Pipe.Stream_Type (Strm.all),
76+
Command => "./pipe_stream",
77+
Args => Args,
78+
Timeout => 60_000,
7379
On_Error => On_Error'Unrestricted_Access);
7480

7581
return Response.Stream (MIME.Application_Octet_Stream, Strm);
@@ -112,7 +118,10 @@ procedure Pipe_Stream is
112118
if I = 25600 then
113119
Append (Output, "OK" & ASCII.LF);
114120
else
115-
Append (Output, "NOK on " & Utils.Image (I) & ASCII.LF);
121+
Append
122+
(Output, "NOK on " & Utils.Image (I) & ASCII.LF &
123+
M & ASCII.LF); -- Output the message body to have some
124+
-- information about the test fails
116125
end if;
117126
end;
118127
end Run_Test;
@@ -150,7 +159,7 @@ procedure Pipe_Stream is
150159
Output : Unbounded_String;
151160
Prev : Unbounded_String;
152161

153-
TA : array (1 .. Barrier.Release_Threshold) of access Tester;
162+
TA : array (1 .. Barrier.Release_Threshold) of access Tester;
154163
Cnt : Natural := 0;
155164

156165
------------------
@@ -167,11 +176,19 @@ procedure Pipe_Stream is
167176

168177
begin
169178
if Command_Line.Argument_Count = 0 then
179+
Conf := Config.Get_Current;
180+
181+
AWS.Config.Set.Server_Name (Conf, "pipe");
182+
AWS.Config.Set.Server_Host (Conf, "localhost");
183+
AWS.Config.Set.Server_Port (Conf, 0);
184+
AWS.Config.Set.Max_Connection (Conf, 10);
185+
AWS.Config.Set.Send_Timeout (Conf, 60.0);
186+
AWS.Config.Set.Cleaner_Server_Response_Timeout (Conf, 120.0);
187+
170188
Server.Start
171-
(WS, "pipe",
172-
CB'Unrestricted_Access,
173-
Host => "localhost",
174-
Port => 0);
189+
(Web_Server => WS,
190+
Callback => CB'Unrestricted_Access,
191+
Config => Conf);
175192

176193
for T of TA loop
177194
T := new Tester;

0 commit comments

Comments
 (0)