Commit a8dd1a8
committed
Fix flaky tests in optional-dependencies CI matrix
Root cause: Three test categories failed on macOS runners.
1. Annoy (Approximate Nearest Neighbors) tests
- Problem: Small test datasets (2-4 records) cause unstable
results. The ANN algorithm returns approximate matches. With
few records, different CPU/platform conditions change which
neighbor is "nearest."
- Fix: Use larger datasets (37 records) so the algorithm works
as designed. Change assertions to check stable properties
(count of matches, presence of expected data) instead of
checking exact neighbor order.
2. Robot Framework elapsed time test
- Problem: CI hosts have variable load. The test checked that
elapsed time was less than 3 seconds. On busy hosts, it took
longer.
- Fix: Allow up to 5 seconds for timing variance.
3. ZIP file comparison test
- Problem: The test compared base64 strings of ZIP files. ZIP
metadata (timestamps, compression) differs between platforms.
The base64 strings did not match even when file contents were
the same.
- Fix: Compare extracted file names and contents instead of
comparing the raw ZIP bytes.
The Annoy algorithm uses random projections to build a search index.
This is efficient for large datasets but gives unstable results for
small datasets. Production code already routes small datasets to the
deterministic Levenshtein algorithm. The tests now use realistic
dataset sizes.1 parent 28c0899 commit a8dd1a8
4 files changed
Lines changed: 78 additions & 46 deletions
File tree
- cumulusci
- salesforce_api/tests
- tasks
- bulkdata
- tests
- robotframework/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
240 | 247 | | |
241 | 248 | | |
242 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
397 | 398 | | |
| 399 | + | |
398 | 400 | | |
399 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
617 | 656 | | |
618 | 657 | | |
619 | 658 | | |
620 | 659 | | |
621 | 660 | | |
622 | 661 | | |
623 | | - | |
624 | | - | |
| 662 | + | |
625 | 663 | | |
626 | 664 | | |
627 | 665 | | |
| |||
632 | 670 | | |
633 | 671 | | |
634 | 672 | | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
642 | 676 | | |
643 | | - | |
| 677 | + | |
644 | 678 | | |
645 | 679 | | |
646 | 680 | | |
| |||
650 | 684 | | |
651 | 685 | | |
652 | 686 | | |
653 | | - | |
654 | | - | |
| 687 | + | |
655 | 688 | | |
656 | 689 | | |
657 | 690 | | |
| |||
663 | 696 | | |
664 | 697 | | |
665 | 698 | | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
676 | 704 | | |
677 | 705 | | |
678 | 706 | | |
| |||
709 | 737 | | |
710 | 738 | | |
711 | 739 | | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
| 740 | + | |
720 | 741 | | |
721 | 742 | | |
722 | 743 | | |
| |||
729 | 750 | | |
730 | 751 | | |
731 | 752 | | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
743 | 762 | | |
744 | 763 | | |
745 | 764 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
829 | | - | |
| 829 | + | |
| 830 | + | |
830 | 831 | | |
831 | 832 | | |
832 | 833 | | |
| |||
0 commit comments