File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1
1
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
2
2
-- SPDX-License-Identifier: Apache-2.0
3
3
4
+ {-
5
+ NOTE On enforcing determinism
6
+
7
+ The tests below use two mechanisms to enforce deterministic LSP sequences:
8
+
9
+ 1. Progress reporting: waitForProgress(Begin|Done)
10
+ 2. Diagnostics: expectDiagnostics
11
+
12
+ Either is fine, but diagnostics are generally more reliable.
13
+
14
+ Mixing them both in the same test is NOT FINE as it will introduce race
15
+ conditions since multiple interleavings are possible. In other words,
16
+ the sequence of diagnostics and progress reports is not deterministic.
17
+ For example:
18
+
19
+ < do something >
20
+ waitForProgressDone
21
+ expectDiagnostics [...]
22
+
23
+ - When the diagnostics arrive after the progress done message, as they usually do, the test will pass
24
+ - When the diagnostics arrive before the progress done msg, when on a slow machine occasionally, the test will timeout
25
+
26
+ Therefore, avoid mixing both progress reports and diagnostics in the same test
27
+ -}
28
+
4
29
{-# LANGUAGE AllowAmbiguousTypes #-}
5
30
{-# LANGUAGE CPP #-}
6
31
{-# LANGUAGE DataKinds #-}
You can’t perform that action at this time.
0 commit comments