Commit ecb1f47
committed
Fix internal cluster and single node security tests (elastic#121466)
This PR fixes SecuritySingleNodeTestCase and ProfileIntegTests tests.
- The security single node test failures are solved by ensuring every test starts with security index created and available. This is in order to have consistent state for every test. With the changes introduce in the elastic#120323 PR, only the first test would execute with .security index being created async. Subsequent tests would execute without security index creation due to the fact that whole cluster is wiped after each test. This caused a flakiness only for the first test, because there was no mechanism in place to ensure that the .security index is active before test execution.
- The profile integration tests are solved by introducing an anonymous role which don't have application privileges. The application privileges are resolved from the .security index and assigned to all users, including the es_test_root user which is used during cluster wiping. Due to asynchronous nature of cluster setup and .security index creation, this now causes flakiness. The main problem is that wiping is done asynchronously and uses es_test_root which had assigned anonymous rac_role which depends on .security index being available for search in order to resolve application privileges. The application privilege resolution is done in buildRoleFromDescriptors which currently does not wait for security index availability(can be improved - but still wouldn't fix internal cluster tests). This wasn't a problem before just because we simply return empty results when .security index does not exist. There is some complexity in making internal clusters wait for availability of security shards before the test, so I think this solution is acceptable given that it's not required for this tests to have anonymous role with application privileges.
Resolves elastic#121022
Resolves elastic#121096
Resolves elastic#121101
Resolves elastic#120988
Resolves elastic#121108
Resolves elastic#120983
Resolves elastic#120987
Resolves elastic#121179
Resolves elastic#121183
Resolves elastic#121346
Resolves elastic#121151
Resolves elastic#120985
Resolves elastic#121039
Resolves elastic#121483
Resolves elastic#121116
Resolves elastic#121258
Resolves elastic#121486
(cherry picked from commit 369c641)
# Conflicts:
# muted-tests.yml
# x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealmElasticAutoconfigIntegTests.java1 parent eed3950 commit ecb1f47
File tree
4 files changed
+74
-101
lines changed- x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch
- test
- xpack/security
- authc/esnative
- profile
4 files changed
+74
-101
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | 398 | | |
405 | 399 | | |
406 | 400 | | |
407 | 401 | | |
408 | 402 | | |
409 | 403 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | 404 | | |
414 | 405 | | |
415 | 406 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | 407 | | |
420 | 408 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | 409 | | |
425 | 410 | | |
426 | 411 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | 412 | | |
437 | 413 | | |
438 | 414 | | |
| |||
445 | 421 | | |
446 | 422 | | |
447 | 423 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | 424 | | |
452 | 425 | | |
453 | 426 | | |
| |||
457 | 430 | | |
458 | 431 | | |
459 | 432 | | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | 433 | | |
467 | 434 | | |
468 | 435 | | |
469 | 436 | | |
470 | 437 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | 438 | | |
475 | 439 | | |
476 | 440 | | |
| |||
480 | 444 | | |
481 | 445 | | |
482 | 446 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | 447 | | |
490 | 448 | | |
491 | 449 | | |
| |||
496 | 454 | | |
497 | 455 | | |
498 | 456 | | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | 457 | | |
506 | 458 | | |
507 | 459 | | |
| |||
518 | 470 | | |
519 | 471 | | |
520 | 472 | | |
521 | | - | |
| 473 | + | |
Lines changed: 55 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
| 59 | + | |
50 | 60 | | |
| 61 | + | |
51 | 62 | | |
52 | 63 | | |
53 | 64 | | |
| |||
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
85 | 103 | | |
86 | 104 | | |
87 | 105 | | |
| |||
100 | 118 | | |
101 | 119 | | |
102 | 120 | | |
103 | | - | |
| 121 | + | |
104 | 122 | | |
105 | 123 | | |
106 | 124 | | |
| |||
362 | 380 | | |
363 | 381 | | |
364 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
365 | 419 | | |
Lines changed: 2 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
18 | | - | |
19 | | - | |
20 | 14 | | |
21 | | - | |
22 | 15 | | |
23 | 16 | | |
24 | 17 | | |
| |||
29 | 22 | | |
30 | 23 | | |
31 | 24 | | |
32 | | - | |
33 | 25 | | |
34 | 26 | | |
35 | | - | |
36 | | - | |
37 | 27 | | |
38 | | - | |
39 | | - | |
40 | 28 | | |
41 | 29 | | |
42 | 30 | | |
| |||
70 | 58 | | |
71 | 59 | | |
72 | 60 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 61 | | |
110 | 62 | | |
111 | 63 | | |
112 | | - | |
| 64 | + | |
113 | 65 | | |
114 | 66 | | |
115 | 67 | | |
| |||
176 | 128 | | |
177 | 129 | | |
178 | 130 | | |
179 | | - | |
| 131 | + | |
180 | 132 | | |
181 | 133 | | |
182 | 134 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
102 | 117 | | |
103 | 118 | | |
104 | 119 | | |
105 | 120 | | |
106 | 121 | | |
107 | 122 | | |
108 | | - | |
| 123 | + | |
109 | 124 | | |
110 | 125 | | |
111 | 126 | | |
| |||
0 commit comments