Skip to content

Commit

Permalink
msglist diffing tests: Fix a flake with stream-subscribed status chan…
Browse files Browse the repository at this point in the history
…ging

In 371e9b4, we said we preferred spreading
eg.plusReduxState.subscriptions...but I guess at that point we
didn't predict this flake.

See 932c28d for a solution to another flake that involved streams
unstably being subscribed / unsubscribed.

Fixes: zulip#5414
  • Loading branch information
chrisbobbe committed Jun 14, 2022
1 parent 815d9f1 commit 14846db
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/webview/__tests__/generateInboundEventEditSequence-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ const pmMessages6 = [
const baseState = eg.reduxStatePlus({
streams: [...eg.plusReduxState.streams, stream1, stream2],
subscriptions: [
...eg.plusReduxState.subscriptions,
// Could spread eg.plusReduxState.subscriptions, for completeness…but
// then we'd invite flakes where random stream IDs in there sometimes
// collide with our fixed ones, changing whether a stream is subscribed
eg.makeSubscription({ stream: stream1 }),
eg.makeSubscription({ stream: stream2 }),
],
Expand Down Expand Up @@ -437,8 +439,12 @@ describe('messages -> piece descriptors -> content HTML is stable/sensible', ()
state: eg.reduxStatePlus({
streams: [...eg.plusReduxState.streams, stream1, stream2],
subscriptions: [
...eg.plusReduxState.subscriptions,
// no subscription for stream1
//
// Could spread eg.plusReduxState.subscriptions, for
// completeness…but then we'd invite flakes where random stream
// IDs in there sometimes collide with our fixed ones, changing
// whether a stream is subscribed
eg.makeSubscription({ stream: stream2 }),
],
}),
Expand Down

0 comments on commit 14846db

Please sign in to comment.