mikeizbicki/cmc-csci143

Passed locally but failed on GitHub

Closed this issue · 4 comments

Hi there,

I encountered an issue that all my sql solutions passed the test on the lambda server but some failed on the GitHub test flows. I tried to look into the log but it seems not provide any useful information.

Only this part

CONTAINER ID   IMAGE           COMMAND                  CREATED                  STATUS                  PORTS      NAMES
6c1d76b0c0b4   pagila-hw3_pg   "docker-entrypoint.s…"   Less than a second ago   Up Less than a second   5432/tcp   pagila-hw3_pg_1
sql/01.sql pass
sql/02.sql pass
sql/03.sql pass
sql/04.sql fail
sql/05b.sql pass
sql/05c.sql pass
sql/05d.sql pass
sql/05e.sql fail
sql/05f.sql fail
sql/05.sql pass
sql/06.sql pass
sql/07.sql pass
sql/08.sql pass
sql/10.sql pass
sql/11.sql fail
sql/12.sql fail
sql/13.sql pass
sql/14.sql fail
sql/15.sql fail
Error: Process completed with exit code 2.

I wonder what would be the best way to dig into the details of the failure to correct my files.

Thank you for your help in advance!

This can happen when your SQL queries are nondeterministic. That is, they are not guaranteed to give the same results every time they are run.

At this point, the only source of nondeterminism we've seen is in the ORDER BY clause. In particular, if the ORDER BY clause does not specify the order in which two rows must appear, then Postgres is allowed to put them in whatever order it wants. The postgres on the lambda server chose to put them in the "correct" order, and the postgres on github chose to put them in the "incorrect" order (for complex reasons we will touch on after spring break). Fixing the ORDER BY clause will remove this nondeterminism and allow you to pass test cases on github.

I was getting the exact same test cases incorrect, and the issue w mine was that I had forgotten make sure github was aware of the new pagila dataset

OMG. l tried that one and it immediately works after 3-hour endless adjusting my ORDER BY clause. Thank you so much!

Whoops, sorry I forgot about this likely footgun for this version of the assignment.

For future students who might encounter this: To make github aware of the updated pagila dataset, you need to make sure you run

$ git add pagila

before committing / pushing your changes to github. In general, changes to submodules (in this case downloading from the new master branch) need to be added to the repo in the same way that changes to files need to be added.