Skip to content

Commit

Permalink
Fix test_cond flaky test under Windows (PaddlePaddle#24633)
Browse files Browse the repository at this point in the history
In the past, the test_cond will fail with 2% probability and easy to re-produce.

Now I re-run 300 times and no failure occurs. The probability of still has the failure is (1 - 2%) ^ 300 ~= 0.00004. We can say the random failure disappears. Maybe someone fixed some bugs in PE.
  • Loading branch information
zhhsplendid authored May 20, 2020
1 parent 2e7e69d commit 00c8ee1
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions python/paddle/fluid/tests/unittests/test_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,6 @@ def cond_func(i, img, label):
lambda: batchnorm_fc_with_inputs(img, label, class_num=10))

for use_parallel_exe in [False, True]:
if use_parallel_exe and os.name == "nt":
print(
"Skip use_parallel_exe=True in Windows because of flaky test when using PE and control flow under Windows"
)
continue

self.backward_value_helper(cond_func,
core.is_compiled_with_cuda(),
use_parallel_exe)
Expand All @@ -493,12 +487,6 @@ def cond_func_simple_net_at_false(i, img, label):
lambda: branch(i, img, label))

for use_parallel_exe in [False, True]:
if use_parallel_exe and os.name == "nt":
print(
"Skip use_parallel_exe=True in Windows because of flaky test when using PE and control flow under Windows"
)
continue

self.backward_value_helper(cond_func_simple_net_at_true,
core.is_compiled_with_cuda(),
use_parallel_exe)
Expand Down Expand Up @@ -526,11 +514,6 @@ def cond_func(i, img, label):
lambda: branch(i, img, label, False))

for use_parallel_exe in [False, True]:
if use_parallel_exe and os.name == "nt":
print(
"Skip use_parallel_exe=True in Windows because of flaky test when using PE and control flow under Windows"
)
continue
self.backward_value_helper(cond_func,
core.is_compiled_with_cuda(),
use_parallel_exe)
Expand Down

0 comments on commit 00c8ee1

Please sign in to comment.