Fix race condition in cat shards test
This commit fixes a test bug in the cat shards REST test. In particular, there was a race condition in the test that would cause the test to sometimes fail. The race condition is that some of the shards would go to state STARTED after the sync flush was issued. These shards would (correctly) show up in the output as having state started but without a sync_id. However, the expected output was written to only look for shards that have state STARTED and a sync_id, or shards that are still INITIALIZING or are UNASSIGNED and (of course) do not have a sync_id. The best approach here is to just simplify the test.
This commit is contained in:
parent
9b3920b52c
commit
95c4846e58
|
@ -91,12 +91,11 @@
|
|||
body:
|
||||
settings:
|
||||
number_of_shards: 5
|
||||
number_of_replicas: 1
|
||||
number_of_replicas: 0
|
||||
|
||||
- do:
|
||||
cluster.health:
|
||||
wait_for_status: yellow
|
||||
wait_for_relocating_shards: 0
|
||||
wait_for_status: green
|
||||
- do:
|
||||
indices.flush_synced:
|
||||
index: sync_id_test
|
||||
|
@ -109,7 +108,7 @@
|
|||
h: index,state,sync_id
|
||||
- match:
|
||||
$body: |
|
||||
/^(sync_id_test\s+(STARTED\s+[A-Za-z0-9_\-]{20}|(INITIALIZING|UNASSIGNED)\s+)\s+\n){10}$/
|
||||
/^(sync_id_test\s+STARTED\s+[A-Za-z0-9_\-]{20}\s+\n){5}$/
|
||||
|
||||
- do:
|
||||
indices.delete:
|
||||
|
|
Loading…
Reference in New Issue