Commit Graph

9 Commits

Author SHA1 Message Date
Alexey Edelev dfc3306e1a Check the return value of QFile::open calls
As it's defined as [[nodiscard]].

Pick-to: 6.8 6.9
Change-Id: I849922ed7bd64a4f67e6da0e11b1d6b4ad38deb7
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2025-01-29 17:30:52 +01:00
Alexey Edelev 4d1653d6f6 Fix the GrpcCallOptions usage in QML
Make QQmlGrpcCallOptions public internal since the class is now
dereferenced in the generated user code. Replace the Qml client method
arguments from QGrpcCallOptions const reference to a QQmlGrpcCallOption
pointer. Add the respective Qml test.

As drive-by change, fix the QQmlGrpcCallOptions metadata property.
The property didn't follow the changes of data in the
QQmlGrpcMetadata, which lead to invalid work of the property. Add the
missing connections.

Pick-to: 6.8
Task-number: QTBUG-120943
Change-Id: I93ca336b3b209aebd35a6b1008507a24e8e11245
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2024-08-28 14:47:48 +02:00
Dennis Oberst a07a905094 Fix stream cancellation and the deadline timeout
The cancel() implementation was not correct in sending an empty data
frame. We need to send the RST_STREAM frame for a proper cancellation.

The deadline timeout now properly cancels the stream and sends the
DeadlineExceeded status-code back to the client.

Rework the test as the previous functionality got barely tested (and was
incorrect too!).

Pick-to: 6.8
Fixes: QTBUG-125375
Change-Id: Iaa3ba60aac887302ae6264d3bbabbccdf666c805
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-06-04 12:29:27 +02:00
Alexey Edelev ad4511d393 Add the 'writesDone' methods to client-side streaming operations
The 'writesDone' method ends the client-side streaming and notifies
server that the client finished the sending of data. Server still may
send the data to the client before terminating the communication. After
calling the method it's expected that the respective streaming
operation will emit either the finished signal. The core difference
between the 'cancel' and 'writesDone' methods is that stream processing
is not finished after the 'writesDone' method is called.

The QGrpcHttp2Client implements this logic by sending stream end
flag to a client-side HTTP/2 stream.

Task-number: QTBUG-123644
Task-number: QTBUG-123625
Change-Id: Ib648d02d167e8e630a7ef37816f62ce95c967273
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-11 19:48:15 +02:00
Alexey Edelev 5189fddaed Refactor the way gRPC test are running
Add the ssl channels to tests. Run the test server with SSL channel
enabled by default.

Add the --latency option to the test server. Server now uses the value
provided by test runner instead of using the global definition.

Rename the test server-related targets, so the have grpc_ prefix now.
The previous name was too generic.

Adjust SSL tests and use GrpcClientTestBase with SslNoCredentials
channels.

Pick-to: 6.6 6.7
Task-number: QTBUG-119207
Change-Id: Ib5cf9d05db62f542f5fc9bf4de1d5af93e6864e0
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-11 14:29:05 +01:00
Konrad Kujawa e7e733aecb Make ServerProcRunner logs more explicit
Move QThead include to .cpp.
Add missing QVERIFY in the server stream Valid() test.
Modify MessageLatencyThreshold to work better with Windows.

Pick-to: 6.6
Change-Id: I791d0ffdf3018ce9db4f062d9c0e7f0e466a6530
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-10-16 14:59:16 +02:00
Alexey Edelev dd96a1da0e Add bidirectional streaming tests
Add test for the valid bidirectional stream communication.

Change-Id: I2f24bdc1473a675c1242134d9ce73eaf94e179a3
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-08-29 10:53:11 +02:00
Alexey Edelev d6550b105f Add client-side streaming tests
Add test for the valid client-side stream communication.

Change-Id: I540d9ac307480d2d83fe2c6fbf22935dca952691
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-08-29 10:53:08 +02:00
Alexey Edelev 558c67a981 Rearrange gRPC client tests
Move all client tests to a common directory. Share the generated client
library between tests. Move the test server to the client tests.

Pick-to: 6.6 6.5
Change-Id: Ia7a2edc2ac1415444790158dd5ad8c4cf7cf9504
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-08-29 10:53:02 +02:00