[ 
https://issues.apache.org/jira/browse/BEAM-7569?focusedWorklogId=261783&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-261783
 ]

ASF GitHub Bot logged work on BEAM-7569:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Jun/19 20:33
            Start Date: 17/Jun/19 20:33
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on pull request #8869: [BEAM-7569] 
Fixes filesystem_test for Windows
URL: https://github.com/apache/beam/pull/8869#discussion_r294505667
 
 

 ##########
 File path: sdks/python/apache_beam/io/filesystem_test.py
 ##########
 @@ -514,25 +514,25 @@ def create_test_file(compression_type, lines):
     # different error, in the Beam 2.13 and earlier implementation.
     # So it's not strictly necessary to have this handler in this unit test.
 
-    def alarm_handler(signum, frame):
-      self.fail('Timed out reading compressed file.')
+    def timeout_handler():
       raise IOError('Exiting due to likley infinite loop logic in code.')
 
-    old_handler = signal.signal(signal.SIGALRM, alarm_handler)
+    timer = threading.Timer(timeout, timeout_handler)
     try:
       test_lines = tuple(generate_random_line() for i in range(num_test_lines))
       for compression_type in [CompressionTypes.BZIP2, CompressionTypes.GZIP]:
         file_name = create_test_file(compression_type, test_lines)
-        signal.alarm(timeout)
+        timer.start()
         with open(file_name, 'rb') as f:
           data = CompressedFile(f, compression_type, read_size=read_size)
           for written_line in test_lines:
             read_line = data.readline()
             self.assertEqual(written_line, read_line)
-        signal.alarm(0)
+        timer.cancel()
+        # Starting a new timer for the next iteration/test.
 
 Review comment:
   makes sense.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 261783)
    Time Spent: 1h 20m  (was: 1h 10m)

> filesystem_test is failing for Windows
> --------------------------------------
>
>                 Key: BEAM-7569
>                 URL: https://issues.apache.org/jira/browse/BEAM-7569
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Chamikara Jayalath
>            Assignee: Chamikara Jayalath
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to