Skip to content

when testing the current philo_bonus, throws error #15

Description

@ytkimirti

It throws this exception because it can't get the output of the command.

Traceback (most recent call last):
  File "socrates/socrates.py", line 302, in <module>
    exit(socrates(args.path, args.philo))
  File "socrates/socrates.py", line 263, in socrates
    test_program(f"{bin_path}/philo_bonus/philo_bonus")
  File "socrates/socrates.py", line 177, in test_program
    if run_starvation_measures(binary) is False:
  File "socrates/socrates.py", line 151, in run_starvation_measures
    results.append(measure_starvation_timing(binary))
  File "socrates/socrates.py", line 114, in measure_starvation_timing
    if data[-1] == "\0":
IndexError: string index out of range

The reason is that the new bonus of the philosophers project says every philosopher has to be a process. So when it tries to get the output of ./philo_bonus, it doesn't capture the output from it's child processes.

So the string data becomes an empty string and throws an exception.

I couldn't really think of a way of capturing output from child processes but I will look into that.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions