[Question][Hw6] Coverage.read doesn't close the input channel of coverage file? #721
Replies: 6 comments
-
I think I found the reason. When I do |
Beta Was this translation helpful? Give feedback.
-
This diff solves the issue: diff --git a/src/coverage.ml b/src/coverage.ml
index 9d17c0e..673328a 100644
--- a/src/coverage.ml
+++ b/src/coverage.ml
@@ -22,6 +22,6 @@ let read coverage_file =
line |> List.tl |> List.hd |> String.trim |> int_of_string
in
(if count > 0 then add line_number coverage else coverage) |> loop ic
- with End_of_file -> coverage
+ with End_of_file -> close_in ic; coverage
in
loop ic empty but as I can't modify the |
Beta Was this translation helpful? Give feedback.
-
We accumulates the coverage information in |
Beta Was this translation helpful? Give feedback.
-
@yeonhee-ryou my issue title is misleading now. I read that file every time I test it, but don't close it->it results in EMFILE error, which returns early with an error. |
Beta Was this translation helpful? Give feedback.
-
I'll check your issue and make a comment tomorrow |
Beta Was this translation helpful? Give feedback.
-
solved it via implementing my own read coverage function. will keep open for the update. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Name: Murad Bashirov
Hello. How does autograder calculates coverage in json parser? I have num of unique crashes: 5, but covered lines: 0.
Beta Was this translation helpful? Give feedback.
All reactions