client icon indicating copy to clipboard operation
client copied to clipboard

[GUI-tests] Open only one socket connection per test scenario

Open saw-jan opened this issue 3 years ago • 6 comments

In the GUI tests, the function hasSyncStatus opens a new socket connection every time it is called. The main issue is with waitForFileOrFolderToHaveSyncStatus function which calls hasSyncStatus function rapidly until the condition is met. So, there will be many socket connection requests in a single test scenario (which may or may not be an issue for the Unix socket server).

IMO, I think we must open only a single socket connection per test scenario. So, in this PR, I have refactored the test code to only create a new socket connection if there is none and reuse the existing connection until a test scenario finishes and close the connection afterward. This way, we will open only one socket connection per scenario.

I tried to reuse a single connection for a whole test suite but that was not possible. I think the connection will be different every time we add a user to the client (I have no idea).

saw-jan avatar Jul 22 '22 11:07 saw-jan

The socket api I designed for long running connections. The windows explroer for examples connect to the socket stays connected until either the client(the explorer) or server (the desktop client) are closed. So I agree that you probably should keep the socket open.

TheOneRing avatar Jul 22 '22 11:07 TheOneRing

Results for GUI-tests https://drone.owncloud.com/owncloud/client/12724/6/1

:boom: The GUI tests failed.

GUI Logs: https://cache.owncloud.com/public/owncloud/client/12724/guiReportUpload/index.html

Server Logs: https://cache.owncloud.com/public/owncloud/client/12724/guiReportUpload/serverlog.log

Screenshots:

ownclouders avatar Jul 22 '22 11:07 ownclouders

The socket api I designed for long running connections. The windows explroer for examples connect to the socket stays connected until either the client(the explorer) or server (the desktop client) are closed. So I agree that you probably should keep the socket open.

If the connection will get closed after closing the desktop client then I guess we won't be able to reuse a single connection for a whole test-suite. That's why I was getting trouble using single connection for a test-suite.

saw-jan avatar Jul 22 '22 11:07 saw-jan

I don't think the test failures with the following screen are because of the test code. We need to find out why this xfce4 login screen comes out during test.

SS

logging_out

saw-jan avatar Jul 25 '22 09:07 saw-jan

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Aug 02 '22 10:08 sonarqubecloud[bot]

~Blocked until https://github.com/owncloud-ci/squish/issues/34~

saw-jan avatar Aug 04 '22 04:08 saw-jan

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Sep 07 '22 06:09 sonarqubecloud[bot]