Page MenuHomePhabricator

eina: Close file in unlink test
AcceptedPublic

Authored by jptiz on Tue, Jul 21, 5:16 PM.

Details

Summary

At least on Windows (didn't have the time to test on Linux yet),
running tests, even if they passed, there would be an Eina error on logs
pointing that a temporary file wasn't closed:

ERR:eina_file ../src/lib/eina/eina_file_common.c:1137 eina_file_shutdown() File [C:/Users/joao_/AppData/Local/Temp/aaaa_file_test_EBpVea] still open 1 times !

In the end, it was the eina_file_test_unlink that would create a temporary
file but never close it, being caught only by eina_shutdown().

Test Plan

meson test -C build eina

Diff Detail

Repository
rEFL core/efl
Branch
devs/jptiz/close-file-unlink
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17171
Build 11440: arc lint + arc unit
jptiz created this revision.Tue, Jul 21, 5:16 PM
jptiz requested review of this revision.Tue, Jul 21, 5:16 PM
vtorri added inline comments.Tue, Jul 21, 9:39 PM
src/tests/eina/eina_test_file.c
889

for me, eina_file_open() fails here because tmpfile has already be opened line 885. Is it also the case for you ?

jptiz added inline comments.Fri, Jul 24, 11:36 AM
src/tests/eina/eina_test_file.c
889

Hm, didn't happen here. Does it happens before or after the patch (or both)?

stefan_schmidt accepted this revision.Wed, Jul 29, 7:25 AM

For me, on Linux, this does not fail either. Patch looks sane. @vtorri could you give it another try?

This revision is now accepted and ready to land.Wed, Jul 29, 7:25 AM

i still have

<test result="failure">
  <path>../src/tests/eina</path>
  <fn>eina_test_file.c:816</fn>
  <id>eina_test_file_mktemp</id>
  <iteration>0</iteration>
  <duration>0.005348</duration>
  <description>File</description>
  <message>Failure &apos;!file&apos; occurred</message>
</test>

see my comment above

src/tests/eina/eina_test_file.c
889

both

jptiz added inline comments.Wed, Jul 29, 8:41 PM
src/tests/eina/eina_test_file.c
889

In that case, would you mind if I open a Task for that and let it for later? There's also an issue regarding removing temporary directory (which is failing in our branch), so I'll be paying attention to this file in this and the next week.

i realize it's not the same function...

but i think my problem should be fixed too in thatpatch

vtorri added inline comments.Fri, Jul 31, 11:24 AM
src/tests/eina/eina_test_file.c
889

declare test_file at the beginning of the block and it will be ok

jptiz updated this revision to Diff 30929.Sat, Aug 1, 8:11 AM

Move test_file declaration to function's beginning.

vtorri accepted this revision.Sat, Aug 1, 8:33 AM