How about construct a Flink test directory under directory specified
under "java.io.tmpdir" and change the permission to not allow create
new directory.
Then the BlobUtilsTest.testExceptionOnCreateStorageDirectoryFailure
test is set to try create "cannot-create-this" under this directory.

Something like:
1. Create /tmp/flink-blob-test-dir at @BeforeClass
2. Change permission to not able to write in here.
3. Try to create Blob store at  /tmp/flink-blob-test-dir/cannot-create-this
4. Throw exception
5. Clean up flink-blob-test-dir


- Henry

On Fri, Feb 13, 2015 at 8:22 AM, Stephan Ewen <[email protected]> wrote:
> Do you have a good idea to fix this?
>
> On Fri, Feb 13, 2015 at 5:15 PM, Henry Saputra <[email protected]>
> wrote:
>
>> I filed an issue to track this: FLINK-1542
>>
>>
>> On Fri, Feb 13, 2015 at 8:09 AM, Henry Saputra <[email protected]>
>> wrote:
>> > Looks like my user role is "admin" at my macbook so I am able to
>> > create directory at "/cannot-create-this".
>> >
>> > We should modify this test to cover this scenario. Assumption that you
>> > cannot create something with default setting probably not a good test.
>> >
>> > - Henry
>> >
>> > On Fri, Feb 13, 2015 at 2:35 AM, Stephan Ewen <[email protected]> wrote:
>> >> Let us know, I am curious as well...
>> >>
>> >> On Fri, Feb 13, 2015 at 9:44 AM, Henry Saputra <[email protected]
>> >
>> >> wrote:
>> >>
>> >>> Hey Ufuk, no I did not run the test with super user priv.
>> >>>
>> >>> That is weird. I will try to figure out why the test is failing in my
>> case.
>> >>>
>> >>> Thanks,
>> >>>
>> >>> - Henry
>> >>>
>> >>> On Fri, Feb 13, 2015 at 12:36 AM, Ufuk Celebi <[email protected]> wrote:
>> >>> > Hey Henry,
>> >>> >
>> >>> > On 13 Feb 2015, at 01:47, Henry Saputra <[email protected]>
>> wrote:
>> >>> >
>> >>> >>  BlobUtilsTest.testExceptionOnCreateStorageDirectoryFailure Expected
>> >>> >> exception: java.lang.Exception
>> >>> >>
>> >>> >>
>> >>> >> Anyone else seen this error before?
>> >>> >
>> >>> > Nope. The test tries to create the root directory
>> "/cannot-create-this",
>> >>> which should not be allowed for non-super users and hence the expected
>> >>> Exception. Are you running it as a user who can create the directory?
>> The
>> >>> assumption might be a little too strong in the test case.
>> >>> >
>> >>> > – Ufuk
>> >>>
>>

Reply via email to