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

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

                Author: ASF GitHub Bot
            Created on: 06/Jan/22 00:33
            Start Date: 06/Jan/22 00:33
    Worklog Time Spent: 10m 
      Work Description: aaltay merged pull request #16437:
URL: https://github.com/apache/beam/pull/16437


   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

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

> Shared object does not read from cache when using tag
> -----------------------------------------------------
>
>                 Key: BEAM-13603
>                 URL: https://issues.apache.org/jira/browse/BEAM-13603
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: ELVIS WIANDA
>            Priority: P1
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> {code:java}
> cat shared_test.py{code}
>  
> {code:java}
> import unittest
> from apache_beam.utils import shared
> class NamedObject(object):
>     def __init__(self, name):
>         self._name = name
>     def get_name(self):
>         return self._name
> class Sequence(object):
>     def __init__(self):
>         self._sequence = 0
>     def make_acquire_fn(self):
>         # Every time acquire_fn is called, increases the sequence number and 
> returns
>         # a NamedObject with that sequenece number.
>         def acquire_fn():
>             self._sequence += 1
>             return NamedObject("sequence%d" % self._sequence)
>         return acquire_fn
> class SharedTest(unittest.TestCase):
>     def testDifferentObjects(self):
>         sequence = Sequence()
>         handle = shared.Shared()
>         f1 = handle.acquire(sequence.make_acquire_fn(), tag="1")
>         self.assertEqual("sequence1", f1.get_name())
>         # should pass
>         f1 = handle.acquire(sequence.make_acquire_fn(), tag="1")
>         self.assertEqual("sequence1", f1.get_name())
> if __name__ == "__main__":
>     unittest.main()
> {code}
> {code:java}
> python shared_test.py {code}
> {code:java}
> F
> ======================================================================
> FAIL: testDifferentObjects (__main__.SharedTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "shared_test.py", line 59, in testDifferentObjects
>     self.assertEqual("sequence1", f1.get_name())
> AssertionError: 'sequence1' != 'sequence2'
> - sequence1
> ?         ^
> + sequence2
> ?         ^
>  
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to