Issue Details (XML | Word | Printable)

Key: SFTP-18
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Lennart Häggkvist
Reporter: Lennart Häggkvist
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
SFTP Transport Project

Concurrency problems when FunctionalTestComponent.getLastReceivedMessage is used in tests

Created: 07/Dec/09 03:31 AM   Updated: 09/Dec/09 01:37 AM
Component/s: Test
Affects Version/s: 2.2.1-RC1
Fix Version/s: 2.2.1-RC2

Time Tracking:
Not Specified

Labels:
User impact: Low
Similar Issues:


 Description  « Hide
If many concurrent calls are made to the callback the FunctionalTestComponent.getLastReceivedMessage could return the same object for 2 (or more) threads.

All tests should get a review to see if the getLastReceivedMessage is used and if so, change it.

Old, wrong code:

FunctionalTestComponent ftc = (FunctionalTestComponent) component;
inputStream = (SftpInputStream) ftc.getLastReceivedMessage();

New:

inputStream = (SftpInputStream) context.getMessage().getPayload();


 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Lennart Häggkvist added a comment - 07/Dec/09 03:57 AM
SftpPoolingFunctionalTestCase is already fixed

Lennart Häggkvist added a comment - 09/Dec/09 01:37 AM
Changed all FunctionalTestComponent.getLastReceivedMessage() to context.getMessage().getPayload() in all relevant tests