@@ -84,7 +84,7 @@ def test_splunk_connection_external(testdir, request):
84
84
# fnmatch_lines does an assertion internally
85
85
result .assert_outcomes (passed = 1 , failed = 0 )
86
86
87
- # make sure that that we get a '0' exit code for the testsuite
87
+ # make sure that we get a '0' exit code for the testsuite
88
88
assert result .ret == 0
89
89
90
90
@@ -117,7 +117,7 @@ def test_splunk_connection_docker(testdir, request):
117
117
# fnmatch_lines does an assertion internally
118
118
result .assert_outcomes (passed = 1 , failed = 0 )
119
119
120
- # make sure that that we get a '0' exit code for the testsuite
120
+ # make sure that we get a '0' exit code for the testsuite
121
121
assert result .ret == 0
122
122
123
123
@@ -165,7 +165,7 @@ def empty_method():
165
165
skipped = len (constants .TA_FICTION_SKIPPED ),
166
166
)
167
167
168
- # make sure that that we get a '0' exit code for the testsuite
168
+ # make sure that we get a '0' exit code for the testsuite
169
169
assert result .ret == 0
170
170
171
171
@@ -328,7 +328,7 @@ def empty_method():
328
328
skipped = len (constants .TA_CIM_FICTION_SKIPPED ),
329
329
)
330
330
331
- # make sure that that we get a '0' exit code for the testsuite
331
+ # make sure that we get a '0' exit code for the testsuite
332
332
assert result .ret == 0
333
333
334
334
@@ -439,7 +439,7 @@ def empty_method():
439
439
failed = 0 ,
440
440
)
441
441
442
- # make sure that that we get a '0' exit code for the testsuite
442
+ # make sure that we get a '0' exit code for the testsuite
443
443
assert result .ret == 0
444
444
445
445
@@ -627,7 +627,7 @@ def empty_method():
627
627
skipped = len (constants .TA_REQ_TRANSITION_SKIPPED ),
628
628
)
629
629
630
- # make sure that that we get a non '0' exit code for the testsuite as it contains failure
630
+ # make sure that we get a non '0' exit code for the testsuite as it contains failure
631
631
assert result .ret == 0 , "result not equal to 0"
632
632
633
633
@@ -682,7 +682,7 @@ def empty_method():
682
682
skipped = len (constants .TA_REQ_BROKEN_SKIPPED ),
683
683
)
684
684
685
- # make sure that that we get a non '0' exit code for the testsuite as it contains failure
685
+ # make sure that we get a non '0' exit code for the testsuite as it contains failure
686
686
assert result .ret != 0
687
687
688
688
@@ -737,5 +737,50 @@ def empty_method():
737
737
skipped = len (constants .TA_REQ_TRANSITION_SKIPPED ),
738
738
)
739
739
740
- # make sure that that we get a non '0' exit code for the testsuite as it contains failure
740
+ # make sure that we get a non '0' exit code for the testsuite as it contains failure
741
741
assert result .ret == 0 , "result not equal to 0"
742
+
743
+
744
+ @pytest .mark .test_infinite_loop_fixture
745
+ @pytest .mark .external
746
+ def test_infinite_loop_in_ingest_data_fixture (testdir , request ):
747
+ """Make sure that pytest accepts our fixture."""
748
+
749
+ testdir .makepyfile (
750
+ """
751
+ from pytest_splunk_addon.standard_lib.addon_basic import Basic
752
+ class Test_App(Basic):
753
+ def empty_method():
754
+ pass
755
+ """
756
+ )
757
+
758
+ shutil .copytree (
759
+ os .path .join (testdir .request .fspath .dirname , "addons/TA_fiction_indextime" ),
760
+ os .path .join (testdir .tmpdir , "package" ),
761
+ )
762
+
763
+ shutil .copytree (
764
+ os .path .join (testdir .request .fspath .dirname , "test_data_models" ),
765
+ os .path .join (testdir .tmpdir , "tests/data_models" ),
766
+ )
767
+
768
+ setup_test_dir (testdir )
769
+ SampleGenerator .clean_samples ()
770
+ Rule .clean_rules ()
771
+
772
+ # run pytest with the following cmd args
773
+ # we are providing wrong sc4s service details here so that we can recreate scenario where first worked raises exception and other workers get stuck
774
+ result = testdir .runpytest (
775
+ "--splunk-app=addons/TA_fiction_indextime" ,
776
+ "--splunk-type=external" ,
777
+ "--splunk-host=splunk" ,
778
+ "--splunk-data-generator=tests/addons/TA_fiction_indextime/default" ,
779
+ "--sc4s-host=splunk" ,
780
+ "--sc4s-port=100" ,
781
+ "-n 2" ,
782
+ )
783
+
784
+ # Here we are not interested in the failures or errors,
785
+ # we are basically checking that we get results and test execution does not get stuck
786
+ assert result .parseoutcomes ().get ("passed" ) > 0
0 commit comments