Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Attempt to fix the flakyness seen with tests #781

Merged
merged 1 commit into from
Mar 29, 2017

Conversation

lukebarnard1
Copy link
Contributor

Specifically:


JS 2.1.1 (Linux 0.0.0) joining a room over federation should not get stuck at a spinner FAILED
	Did not find exactly one match (found: 0) for componentType:function (props, context, updater) {

actually meant that the room directory wasn't displayed - probably because the dispatch view_room_directory ended up on another tick of the event loop, meaning that the directory wasn't displayedi. The fix attempted in ths commit is to use this._setPage instead to view the directory. This uses setState to set the screen to the directory, so I'm not entirely convinced this will solve the problem (as setState may also end up doing things on another tick.

and

JS 2.1.1 (Linux 0.0.0) loading: MatrixClient rehydrated from stored credentials: shows a room view if we followed a room link FAILED
	MatrixChat still not ready after 5 tries
	awaitRoomView@/home/travis/build/vector-im/riot-web/test/all-tests.js:201363:90

was happening probably because in the handler for the sync event in MatrixChat (around line 840), there was one case in which the ready state may not be true (causing all 5 attempts to fail), and this case relied on starting_room_alias_payload. This starting_room_alias_payload is now redundant because of initialScreenAfterLogin, which was added recently.

Specifically:
```

JS 2.1.1 (Linux 0.0.0) joining a room over federation should not get stuck at a spinner FAILED
	Did not find exactly one match (found: 0) for componentType:function (props, context, updater) {
```

actually meant that the room directory wasn't displayed - probably because the dispatch `view_room_directory` ended up on another tick of the event loop, meaning that the directory wasn't displayedi. The fix attempted in ths commit is to use `this._setPage` instead to view the directory. This uses `setState` to set the screen to the directory, so I'm not entirely convinced this will solve the problem (as `setState` may also end up doing things on another tick.

and

```
JS 2.1.1 (Linux 0.0.0) loading: MatrixClient rehydrated from stored credentials: shows a room view if we followed a room link FAILED
	MatrixChat still not ready after 5 tries
	awaitRoomView@/home/travis/build/vector-im/riot-web/test/all-tests.js:201363:90
```

was happening probably because in the handler for the `sync` event in `MatrixChat` (around line 840), there was one case in which the `ready` state may not be true (causing all 5 attempts to fail), and this case relied on `starting_room_alias_payload`. This `starting_room_alias_payload` is now redundant because of `initialScreenAfterLogin`, which was added recently.
@lukebarnard1
Copy link
Contributor Author

Seeing how this now fails, I realise that the tests expect MatrixChat itself to be selecting the correct screen at the right time based on window.location, but if login is involved, this is done via initialScreenAfterLogin, which is not set by any of the tests.

lukebarnard1 pushed a commit to element-hq/element-web that referenced this pull request Mar 29, 2017
This is an attempt to reduce flakiness (see matrix-org/matrix-react-sdk#781 also)
@lukebarnard1 lukebarnard1 merged commit 5a411ba into develop Mar 29, 2017
martindale pushed a commit to FabricLabs/matrix-react-sdk that referenced this pull request Dec 8, 2018
…f-failed

Prevent messages from being sent if other messages have failed to send
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants